-fixing
[oweals/gnunet.git] / src / util / os_installation.c
index 3e0efa0bfa49402e683e9c95d5cd0616e9859a68..035259ff6b234e1d0305044b51222fd2f4380cb1 100644 (file)
@@ -65,7 +65,7 @@ get_path_from_proc_maps ()
   while (NULL != fgets (line, sizeof (line), f))
   {
     if ((1 ==
-         SSCANF (line, "%*x-%*x %*c%*c%*c%*c %*x %*2u:%*2u %*u%*[ ]%s", dir)) &&
+         SSCANF (line, "%*x-%*x %*c%*c%*c%*c %*x %*2u:%*2u %*u%*[ ]%1023s", dir)) &&
         (NULL != (lgu = strstr (dir, "libgnunetutil"))))
     {
       lgu[0] = '\0';
@@ -573,6 +573,8 @@ GNUNET_OS_get_libexec_binary_path (const char *progname)
   char *libexecdir;
   char *binary;
 
+  if (DIR_SEPARATOR == progname[0])
+    return GNUNET_strdup (progname);
   libexecdir = GNUNET_OS_installation_get_path (GNUNET_OS_IPK_LIBEXECDIR);
   if (NULL == libexecdir)
     return GNUNET_strdup (progname);