projects
/
oweals
/
gnunet.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
2e47428
)
-make freebsd7 happy
author
Christian Grothoff
<christian@grothoff.org>
Thu, 29 Nov 2012 18:01:17 +0000
(18:01 +0000)
committer
Christian Grothoff
<christian@grothoff.org>
Thu, 29 Nov 2012 18:01:17 +0000
(18:01 +0000)
src/util/common_allocation.c
patch
|
blob
|
history
diff --git
a/src/util/common_allocation.c
b/src/util/common_allocation.c
index 22dfb2509c3538fc459c9fac07538f4b15b930e0..89be027e706b5caa9ae22810d543a52666d8214b 100644
(file)
--- 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).
*