svn commit: samba r18018 - in branches/SAMBA_4_0/source/lib: ldb/replace replace

vlendec at samba.org vlendec at samba.org
Sun Sep 3 16:33:12 GMT 2006


Author: vlendec
Date: 2006-09-03 16:33:12 +0000 (Sun, 03 Sep 2006)
New Revision: 18018

WebSVN: http://websvn.samba.org/cgi-bin/viewcvs.cgi?view=rev&root=samba&rev=18018

Log:
Fix the build on OpenBSD. No license problem this time, I've written strnlen
from scratch.

Volker


Modified:
   branches/SAMBA_4_0/source/lib/ldb/replace/replace.c
   branches/SAMBA_4_0/source/lib/replace/replace.c


Changeset:
Modified: branches/SAMBA_4_0/source/lib/ldb/replace/replace.c
===================================================================
--- branches/SAMBA_4_0/source/lib/ldb/replace/replace.c	2006-09-03 12:30:55 UTC (rev 18017)
+++ branches/SAMBA_4_0/source/lib/ldb/replace/replace.c	2006-09-03 16:33:12 UTC (rev 18018)
@@ -23,7 +23,7 @@
 #include "includes.h"
 #include "ldb/include/includes.h"
 
-#ifndef HAVE_STRNLEN
+#if !defined(HAVE_STRNLEN) && !defined(_SAMBA_BUILD_)
 /**
  Some platforms don't have strnlen
 **/

Modified: branches/SAMBA_4_0/source/lib/replace/replace.c
===================================================================
--- branches/SAMBA_4_0/source/lib/replace/replace.c	2006-09-03 12:30:55 UTC (rev 18017)
+++ branches/SAMBA_4_0/source/lib/replace/replace.c	2006-09-03 16:33:12 UTC (rev 18018)
@@ -367,7 +367,23 @@
 #endif /* HAVE_SYSLOG */
 #endif /* HAVE_VSYSLOG */
 
-
+#ifndef HAVE_STRNLEN
+/**
+ Some platforms don't have strnlen
+**/
+ size_t strnlen(const char *s, size_t max)
+{
+        size_t len;
+  
+        for (len = 0; len < max; len++) {
+                if (s[len] == '\0') {
+                        break;
+                }
+        }
+        return len;  
+}
+#endif
+  
 #ifndef HAVE_STRNDUP
 /**
  Some platforms don't have strndup.



More information about the samba-cvs mailing list