]> mj.ucw.cz Git - libucw.git/blobdiff - ucw/string.c
Daemon: daemon_control() finished
[libucw.git] / ucw / string.c
index 195976978a4e369e78ee00263961af141d4c0ee5..bb1fae1af01510e163f96dd630627ec5d1f08125 100644 (file)
@@ -2,7 +2,7 @@
  *     UCW Library -- String Routines
  *
  *     (c) 2006 Pavel Charvat <pchar@ucw.cz>
- *     (c) 2007--2008 Martin Mares <mj@ucw.cz>
+ *     (c) 2007--2012 Martin Mares <mj@ucw.cz>
  *
  *     This software may be freely distributed and used according to the terms
  *     of the GNU Lesser General Public License.
 
 #undef LOCAL_DEBUG
 
-#include "ucw/lib.h"
-#include "ucw/string.h"
+#include <ucw/lib.h>
+#include <ucw/string.h>
+
+#ifdef CONFIG_DARWIN
+uns
+strnlen(const char *str, uns n)
+{
+  const char *end = str + n;
+  const char *c;
+  for (c = str; *c && c < end; c++);
+  return c - str;
+}
+#endif
 
 char *
 str_format_flags(char *dest, const char *fmt, uns flags)