aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/util/common_allocation.c2
1 files changed, 1 insertions, 1 deletions
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,
272 char *res; 272 char *res;
273 273
274 GNUNET_assert_at (str != NULL, filename, linenumber); 274 GNUNET_assert_at (str != NULL, filename, linenumber);
275 len = GNUNET_MIN (len, strlen (str)); 275 len = strnlen (str, len);
276 res = GNUNET_xmalloc_ (len + 1, filename, linenumber); 276 res = GNUNET_xmalloc_ (len + 1, filename, linenumber);
277 memcpy (res, str, len); 277 memcpy (res, str, len);
278 /* res[len] = '\0'; 'malloc' zeros out anyway */ 278 /* res[len] = '\0'; 'malloc' zeros out anyway */