diff options
Diffstat (limited to 'source4/lib/replace/replace.c')
-rw-r--r-- | source4/lib/replace/replace.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/source4/lib/replace/replace.c b/source4/lib/replace/replace.c index b8f4bc1c3c..1cf91751b3 100644 --- a/source4/lib/replace/replace.c +++ b/source4/lib/replace/replace.c @@ -387,6 +387,20 @@ duplicate a string } #endif +#ifndef HAVE_STRNLEN +/** + Some platforms don't have strnlen +**/ + + size_t strnlen(const char *s, size_t n) +{ + size_t i; + for (i=0; i<n && s[i] != '\0'; i++) + /* noop */ ; + return i; +} +#endif + #ifndef HAVE_WAITPID int waitpid(pid_t pid,int *status,int options) { |