diff options
Diffstat (limited to 'source3/lib/util_str.c')
-rw-r--r-- | source3/lib/util_str.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c index 6fdca658cd..9a841a36b3 100644 --- a/source3/lib/util_str.c +++ b/source3/lib/util_str.c @@ -1001,3 +1001,15 @@ some platforms don't have strndup return ret; } #endif + +#ifndef HAVE_STRNLEN +/******************************************************************* +some platforms don't have strndup +********************************************************************/ + size_t strnlen(const char *s, size_t n) +{ + int i; + for (i=0; s[i] && i<n; i++) /* noop */ ; + return i; +} +#endif |