aboutsummaryrefslogtreecommitdiff
path: root/src/util/os_installation.c
diff options
context:
space:
mode:
authorgrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2010-06-18 14:30:23 +0000
committergrothoff <grothoff@140774ce-b5e7-0310-ab8b-a85725594a96>2010-06-18 14:30:23 +0000
commit551637a1683c27fe87879a7cdd872dd242ed2988 (patch)
tree9b36e245d428fd641512eb1e1ff86b2a83adf2c2 /src/util/os_installation.c
parent8cf2ba9bcb452ee1b7a998fc4128a4d27283c45c (diff)
code clean up
git-svn-id: https://gnunet.org/svn/gnunet@11805 140774ce-b5e7-0310-ab8b-a85725594a96
Diffstat (limited to 'src/util/os_installation.c')
-rw-r--r--src/util/os_installation.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/src/util/os_installation.c b/src/util/os_installation.c
index c610281878..19469e81e3 100644
--- a/src/util/os_installation.c
+++ b/src/util/os_installation.c
@@ -96,11 +96,12 @@ get_path_from_proc_exe ()
GNUNET_snprintf (fn,
sizeof(fn), "/proc/%u/exe", getpid ());
size = readlink (fn, lnk, sizeof (lnk)-1);
- if ((size == 0) || (size >= sizeof(lnk)-1))
+ if (size <= 0)
{
GNUNET_log_strerror_file (GNUNET_ERROR_TYPE_ERROR, "readlink", fn);
return NULL;
}
+ GNUNET_assert (size < sizeof (lnk));
lnk[size] = '\0';
while ((lnk[size] != '/') && (size > 0))
size--;