summaryrefslogtreecommitdiff
path: root/source4/lib/replace/replace.c
diff options
context:
space:
mode:
authorVolker Lendecke <vlendec@samba.org>2006-08-26 16:19:22 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 14:16:47 -0500
commitd3c55f028e4160506538c9e1c57d3a6e22701a3c (patch)
treec612078e048ce8bf65f25ae0d7f4e1839d4f7657 /source4/lib/replace/replace.c
parent25ba47eaf8a8c66ab131701e61a6ea8c2a0e49d8 (diff)
downloadsamba-d3c55f028e4160506538c9e1c57d3a6e22701a3c.tar.gz
samba-d3c55f028e4160506538c9e1c57d3a6e22701a3c.tar.bz2
samba-d3c55f028e4160506538c9e1c57d3a6e22701a3c.zip
r17840: A step towards building on Solaris which appears not to have strnlen.
Volker (This used to be commit ebf75c6196afdd4bfa4f11bb1d45d385ab0babed)
Diffstat (limited to 'source4/lib/replace/replace.c')
-rw-r--r--source4/lib/replace/replace.c14
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)
{