From: Frank Lahm Date: Fri, 25 May 2012 10:18:58 +0000 (+0200) Subject: Merge remote branch 'sf/develop' into develop X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=netatalk.git;a=commitdiff_plain;h=831306e866cb444e2af19e0f968e04eab5106e9c;hp=e0d6aef6917c6ba51c193ef9e8461180cbf197c6 Merge remote branch 'sf/develop' into develop --- diff --git a/libatalk/compat/misc.c b/libatalk/compat/misc.c index 0bd45a73..58115315 100644 --- a/libatalk/compat/misc.c +++ b/libatalk/compat/misc.c @@ -11,3 +11,17 @@ int dirfd(DIR *dir) return dir->d_fd; } #endif + +#ifndef 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