aboutsummaryrefslogtreecommitdiffstats
path: root/openbsc/src/talloc.c
diff options
context:
space:
mode:
authorHolger Hans Peter Freyther <zecke@selfish.org>2009-11-24 19:58:01 +0100
committerHolger Hans Peter Freyther <zecke@selfish.org>2009-11-24 19:58:01 +0100
commit9de4a6daa948ce2631ae8aa7f1fa311428b2bc7a (patch)
tree5d74034d9c056dfceea6b3a80d87cb8fb6c0be6b /openbsc/src/talloc.c
parent851ace9f331a1488b51af6ce269794025fd1ff46 (diff)
parent2d501ea26a219176b1c556449e45ebd90d4accfb (diff)
Merge branch 'master' into on-waves/bsc-master
Conflicts: openbsc/src/abis_nm.c openbsc/src/bsc_init.c openbsc/src/vty_interface.c
Diffstat (limited to 'openbsc/src/talloc.c')
-rw-r--r--openbsc/src/talloc.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/openbsc/src/talloc.c b/openbsc/src/talloc.c
index bd5e1b0e0..d8213238e 100644
--- a/openbsc/src/talloc.c
+++ b/openbsc/src/talloc.c
@@ -105,6 +105,15 @@
#endif
#endif
+#ifdef __APPLE__
+/* taken from http://insanecoding.blogspot.com/2007/03/methods-for-safe-string-handling.html */
+size_t strnlen(const char *s, size_t n)
+{
+ const char *p = (const char *)memchr(s, 0, n);
+ return(p ? p-s : n);
+}
+#endif
+
/* this null_context is only used if talloc_enable_leak_report() or
talloc_enable_leak_report_full() is called, otherwise it remains
NULL