Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/common/lib/libc/string Make strnlen implementation usable fr...



details:   https://anonhg.NetBSD.org/src/rev/df558dc6d1f2
branches:  trunk
changeset: 325846:df558dc6d1f2
user:      apb <apb%NetBSD.org@localhost>
date:      Thu Jan 09 11:25:11 2014 +0000

description:
Make strnlen implementation usable from src/tools/compat.

diffstat:

 common/lib/libc/string/strnlen.c |  10 ++++++++--
 1 files changed, 8 insertions(+), 2 deletions(-)

diffs (37 lines):

diff -r f060bcab9622 -r df558dc6d1f2 common/lib/libc/string/strnlen.c
--- a/common/lib/libc/string/strnlen.c  Thu Jan 09 02:18:55 2014 +0000
+++ b/common/lib/libc/string/strnlen.c  Thu Jan 09 11:25:11 2014 +0000
@@ -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 <das%FreeBSD.org@localhost>
@@ -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 @@
 #include <lib/libkern/libkern.h>
 #endif
 
+#if !HAVE_STRNLEN
 size_t
 strnlen(const char *s, size_t maxlen)
 {
@@ -49,3 +54,4 @@
        }
        return (len);
 }
+#endif /* !HAVE_STRNLEN */



Home | Main Index | Thread Index | Old Index