aboutsummaryrefslogtreecommitdiff
path: root/src/util/common_allocation.c
diff options
context:
space:
mode:
authorChristian Grothoff <christian@grothoff.org>2012-11-29 18:01:17 +0000
committerChristian Grothoff <christian@grothoff.org>2012-11-29 18:01:17 +0000
commit1bf018f5671ec26fea3c2a4bbe6ff23b4b1dc8e3 (patch)
tree9ce535092644968a03c6bc643240c6953d39a9ff /src/util/common_allocation.c
parent2e474287ecc20d6b230bf0fb6916f3b965f84e5e (diff)
downloadgnunet-1bf018f5671ec26fea3c2a4bbe6ff23b4b1dc8e3.tar.gz
gnunet-1bf018f5671ec26fea3c2a4bbe6ff23b4b1dc8e3.zip
-make freebsd7 happy
Diffstat (limited to 'src/util/common_allocation.c')
-rw-r--r--src/util/common_allocation.c15
1 files changed, 15 insertions, 0 deletions
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)
256} 256}
257 257
258 258
259#if ! HAVE_STRNLEN
260static size_t
261strnlen (const char *s,
262 size_t n)
263{
264 const char *e;
265
266 e = memchr (s, '\0', n);
267 if (NULL == e)
268 return n;
269 return e - s;
270}
271#endif
272
273
259/** 274/**
260 * Dup partially a string (same semantics as strndup). 275 * Dup partially a string (same semantics as strndup).
261 * 276 *