From: Christian Grothoff Date: Tue, 13 Nov 2012 00:22:35 +0000 (+0000) Subject: -wtf X-Git-Tag: initial-import-from-subversion-38251~10890 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=7919161117c5c4d952e664a46b7cf5c1e4c9c5b2;p=oweals%2Fgnunet.git -wtf --- diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c index 1828d826a..22dfb2509 100644 --- a/src/util/common_allocation.c +++ b/src/util/common_allocation.c @@ -272,7 +272,7 @@ GNUNET_xstrndup_ (const char *str, size_t len, const char *filename, char *res; GNUNET_assert_at (str != NULL, filename, linenumber); - len = GNUNET_MIN (len, strlen (str)); + len = strnlen (str, len); res = GNUNET_xmalloc_ (len + 1, filename, linenumber); memcpy (res, str, len); /* res[len] = '\0'; 'malloc' zeros out anyway */