From: Christian Grothoff Date: Thu, 29 Nov 2012 18:01:17 +0000 (+0000) Subject: -make freebsd7 happy X-Git-Tag: initial-import-from-subversion-38251~10675 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=1bf018f5671ec26fea3c2a4bbe6ff23b4b1dc8e3;p=oweals%2Fgnunet.git -make freebsd7 happy --- diff --git a/src/util/common_allocation.c b/src/util/common_allocation.c index 22dfb2509..89be027e7 100644 --- a/src/util/common_allocation.c +++ b/src/util/common_allocation.c @@ -256,6 +256,21 @@ GNUNET_xstrdup_ (const char *str, const char *filename, int linenumber) } +#if ! HAVE_STRNLEN +static size_t +strnlen (const char *s, + size_t n) +{ + const char *e; + + e = memchr (s, '\0', n); + if (NULL == e) + return n; + return e - s; +} +#endif + + /** * Dup partially a string (same semantics as strndup). *