Module Name: src Committed By: apb Date: Thu Jan 9 11:25:11 UTC 2014
Modified Files: src/common/lib/libc/string: strnlen.c Log Message: Make strnlen implementation usable from src/tools/compat. To generate a diff of this commit: cvs rdiff -u -r1.1 -r1.2 src/common/lib/libc/string/strnlen.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/common/lib/libc/string/strnlen.c diff -u src/common/lib/libc/string/strnlen.c:1.1 src/common/lib/libc/string/strnlen.c:1.2 --- src/common/lib/libc/string/strnlen.c:1.1 Thu Sep 1 22:35:18 2011 +++ src/common/lib/libc/string/strnlen.c Thu Jan 9 11:25:11 2014 @@ -1,4 +1,4 @@ -/* $NetBSD: strnlen.c,v 1.1 2011/09/01 22:35:18 jym Exp $ */ +/* $NetBSD: strnlen.c,v 1.2 2014/01/09 11:25:11 apb Exp $ */ /*- * Copyright (c) 2009 David Schultz <d...@freebsd.org> @@ -26,9 +26,13 @@ * SUCH DAMAGE. */ +#if HAVE_NBTOOL_CONFIG_H +#include "nbtool_config.h" +#endif + #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: strnlen.c,v 1.1 2011/09/01 22:35:18 jym Exp $"); +__RCSID("$NetBSD: strnlen.c,v 1.2 2014/01/09 11:25:11 apb Exp $"); #endif /* LIBC_SCCS and not lint */ /* FreeBSD: src/lib/libc/string/strnlen.c,v 1.1 2009/02/28 06:00:58 das Exp */ @@ -38,6 +42,7 @@ __RCSID("$NetBSD: strnlen.c,v 1.1 2011/0 #include <lib/libkern/libkern.h> #endif +#if !HAVE_STRNLEN size_t strnlen(const char *s, size_t maxlen) { @@ -49,3 +54,4 @@ strnlen(const char *s, size_t maxlen) } return (len); } +#endif /* !HAVE_STRNLEN */