r18040: Use only one strnlen implementation
authorJelmer Vernooij <jelmer@samba.org>
Mon, 4 Sep 2006 13:10:14 +0000 (13:10 +0000)
committerGerald (Jerry) Carter <jerry@samba.org>
Wed, 10 Oct 2007 19:17:06 +0000 (14:17 -0500)
source/lib/replace/replace.c

index 5333c6a9fe4fc15160ab1912479cd905bc249b80..1c05c14eb64817feaa2ce7bc0ac404503d4d3779 100644 (file)
@@ -375,7 +375,7 @@ void rep_vsyslog (int facility_priority, char *format, va_list arglist)
 /**
  Some platforms don't have strnlen
 **/
- size_t strnlen(const char *s, size_t max)
+ size_t rep_strnlen(const char *s, size_t max)
 {
         size_t len;
   
@@ -540,19 +540,6 @@ char *rep_strtok_r(char *s, const char *delim, char **save_ptr)
 }
 #endif
 
-#ifndef HAVE_STRNLEN
-/**
- Some platforms don't have strnlen
-**/
-size_t rep_strnlen(const char *s, size_t n)
-{
-       int i;
-       for (i=0; s[i] && i<n; i++)
-               /* noop */ ;
-       return i;
-}
-#endif
-
 #ifndef HAVE_STRTOLL
 long long int rep_strtoll(const char *str, char **endptr, int base)
 {