summaryrefslogtreecommitdiff
path: root/common/lib/libc/string
diff options
context:
space:
mode:
authorchristos <christos@NetBSD.org>2007-06-04 18:19:26 +0000
committerchristos <christos@NetBSD.org>2007-06-04 18:19:26 +0000
commita8565cf99b88ffe6143bc83dbb95eb10c476ce23 (patch)
treee91c2bc1334427d8e8a680abdbd68e88a49f9096 /common/lib/libc/string
parent2219d66ee753e7e806b94d82a436684259184fbf (diff)
handle fortify, ansify.
Diffstat (limited to 'common/lib/libc/string')
-rw-r--r--common/lib/libc/string/bcmp.c8
-rw-r--r--common/lib/libc/string/bcopy.c19
-rw-r--r--common/lib/libc/string/ffs.c7
-rw-r--r--common/lib/libc/string/memchr.c9
-rw-r--r--common/lib/libc/string/memcmp.c8
-rw-r--r--common/lib/libc/string/memset.c18
-rw-r--r--common/lib/libc/string/strcasecmp.c7
-rw-r--r--common/lib/libc/string/strcat.c12
-rw-r--r--common/lib/libc/string/strchr.c9
-rw-r--r--common/lib/libc/string/strcmp.c7
-rw-r--r--common/lib/libc/string/strcpy.c12
-rw-r--r--common/lib/libc/string/strlcat.c9
-rw-r--r--common/lib/libc/string/strlcpy.c9
-rw-r--r--common/lib/libc/string/strlen.c7
-rw-r--r--common/lib/libc/string/strncasecmp.c8
-rw-r--r--common/lib/libc/string/strncmp.c8
-rw-r--r--common/lib/libc/string/strncpy.c9
-rw-r--r--common/lib/libc/string/strrchr.c10
-rw-r--r--common/lib/libc/string/strsep.c8
-rw-r--r--common/lib/libc/string/strstr.c7
20 files changed, 84 insertions, 107 deletions
diff --git a/common/lib/libc/string/bcmp.c b/common/lib/libc/string/bcmp.c
index bc9acc378ed..e781969894f 100644
--- a/common/lib/libc/string/bcmp.c
+++ b/common/lib/libc/string/bcmp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bcmp.c,v 1.1 2005/12/20 19:28:52 christos Exp $ */
+/* $NetBSD: bcmp.c,v 1.2 2007/06/04 18:19:26 christos Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)bcmp.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: bcmp.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
+__RCSID("$NetBSD: bcmp.c,v 1.2 2007/06/04 18:19:26 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -50,9 +50,7 @@ __RCSID("$NetBSD: bcmp.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
* bcmp -- vax cmpc3 instruction
*/
int
-bcmp(b1, b2, length)
- const void *b1, *b2;
- size_t length;
+bcmp(const void *b1, const void *b2, size_t length)
{
const char *p1 = b1, *p2 = b2;
diff --git a/common/lib/libc/string/bcopy.c b/common/lib/libc/string/bcopy.c
index b61de64ea26..2a6571fedd3 100644
--- a/common/lib/libc/string/bcopy.c
+++ b/common/lib/libc/string/bcopy.c
@@ -1,4 +1,4 @@
-/* $NetBSD: bcopy.c,v 1.2 2006/02/05 06:47:48 ross Exp $ */
+/* $NetBSD: bcopy.c,v 1.3 2007/06/04 18:19:27 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)bcopy.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: bcopy.c,v 1.2 2006/02/05 06:47:48 ross Exp $");
+__RCSID("$NetBSD: bcopy.c,v 1.3 2007/06/04 18:19:27 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -48,6 +48,12 @@ __RCSID("$NetBSD: bcopy.c,v 1.2 2006/02/05 06:47:48 ross Exp $");
#include <lib/libkern/libkern.h>
#endif
+#ifdef _FORTIFY_SOURCE
+#undef bcopy
+#undef memcpy
+#undef memmove
+#endif
+
/*
* sizeof(word) MUST BE A POWER OF TWO
* SO THAT wmask BELOW IS ALL ONES
@@ -64,19 +70,16 @@ typedef long word; /* "word" used for optimal copy speed */
*/
#ifdef MEMCOPY
void *
-memcpy(dst0, src0, length)
+memcpy(void *dst0, const void *src0, size_t length)
#else
#ifdef MEMMOVE
void *
-memmove(dst0, src0, length)
+memmove(void *dst0, const void *src0, size_t length)
#else
void
-bcopy(src0, dst0, length)
+bcopy(const void *src0, void *dst0, size_t length)
#endif
#endif
- void *dst0;
- const void *src0;
- size_t length;
{
char *dst = dst0;
const char *src = src0;
diff --git a/common/lib/libc/string/ffs.c b/common/lib/libc/string/ffs.c
index cc4d5ca6a22..b9ee32c93a6 100644
--- a/common/lib/libc/string/ffs.c
+++ b/common/lib/libc/string/ffs.c
@@ -1,4 +1,4 @@
-/* $NetBSD: ffs.c,v 1.1 2005/12/20 19:28:52 christos Exp $ */
+/* $NetBSD: ffs.c,v 1.2 2007/06/04 18:19:27 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)ffs.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: ffs.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
+__RCSID("$NetBSD: ffs.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -51,8 +51,7 @@ __RCSID("$NetBSD: ffs.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
* ffs -- vax ffs instruction
*/
int
-ffs(mask)
- int mask;
+ffs(int mask)
{
int bit;
diff --git a/common/lib/libc/string/memchr.c b/common/lib/libc/string/memchr.c
index 8faf3e61678..d2824e59f4b 100644
--- a/common/lib/libc/string/memchr.c
+++ b/common/lib/libc/string/memchr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: memchr.c,v 1.1 2005/12/20 19:28:52 christos Exp $ */
+/* $NetBSD: memchr.c,v 1.2 2007/06/04 18:19:27 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)memchr.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: memchr.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
+__RCSID("$NetBSD: memchr.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -49,10 +49,7 @@ __RCSID("$NetBSD: memchr.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
#endif
void *
-memchr(s, c, n)
- const void *s;
- unsigned char c;
- size_t n;
+memchr(const void *s, int c, size_t n)
{
_DIAGASSERT(s != NULL);
diff --git a/common/lib/libc/string/memcmp.c b/common/lib/libc/string/memcmp.c
index a155da43537..12880486b35 100644
--- a/common/lib/libc/string/memcmp.c
+++ b/common/lib/libc/string/memcmp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: memcmp.c,v 1.1 2005/12/20 19:28:52 christos Exp $ */
+/* $NetBSD: memcmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)memcmp.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: memcmp.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
+__RCSID("$NetBSD: memcmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -52,9 +52,7 @@ __RCSID("$NetBSD: memcmp.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
* Compare memory regions.
*/
int
-memcmp(s1, s2, n)
- const void *s1, *s2;
- size_t n;
+memcmp(const void *s1, const void *s2, size_t n)
{
_DIAGASSERT(s1 != 0);
_DIAGASSERT(s2 != 0);
diff --git a/common/lib/libc/string/memset.c b/common/lib/libc/string/memset.c
index 4092ded2b2b..b135d985356 100644
--- a/common/lib/libc/string/memset.c
+++ b/common/lib/libc/string/memset.c
@@ -1,4 +1,4 @@
-/* $NetBSD: memset.c,v 1.1 2005/12/20 19:28:52 christos Exp $ */
+/* $NetBSD: memset.c,v 1.2 2007/06/04 18:19:27 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)memset.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: memset.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
+__RCSID("$NetBSD: memset.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -55,25 +55,25 @@ __RCSID("$NetBSD: memset.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
#define wsize sizeof(u_int)
#define wmask (wsize - 1)
+#ifdef _FORTIFY_SOURCE
+#undef bzero
+#undef memset
+#endif
+
#ifdef BZERO
#define RETURN return
#define VAL 0
#define WIDEVAL 0
void
-bzero(dst0, length)
- void *dst0;
- size_t length;
+bzero(void *dst0, size_t length)
#else
#define RETURN return (dst0)
#define VAL c0
#define WIDEVAL c
void *
-memset(dst0, c0, length)
- void *dst0;
- int c0;
- size_t length;
+memset(void *dst0, int c0, size_t length)
#endif
{
size_t t;
diff --git a/common/lib/libc/string/strcasecmp.c b/common/lib/libc/string/strcasecmp.c
index ff8aea0efa4..ad4e78ee7ed 100644
--- a/common/lib/libc/string/strcasecmp.c
+++ b/common/lib/libc/string/strcasecmp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strcasecmp.c,v 1.1 2005/12/20 19:28:52 christos Exp $ */
+/* $NetBSD: strcasecmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: strcasecmp.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
+__RCSID("$NetBSD: strcasecmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -53,8 +53,7 @@ __weak_alias(strncasecmp,_strncasecmp)
#endif
int
-strcasecmp(s1, s2)
- const char *s1, *s2;
+strcasecmp(const char *s1, const char *s2)
{
const unsigned char *us1 = (const unsigned char *)s1,
*us2 = (const unsigned char *)s2;
diff --git a/common/lib/libc/string/strcat.c b/common/lib/libc/string/strcat.c
index 9bd93503f85..0d83d456240 100644
--- a/common/lib/libc/string/strcat.c
+++ b/common/lib/libc/string/strcat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strcat.c,v 1.1 2005/12/20 19:28:52 christos Exp $ */
+/* $NetBSD: strcat.c,v 1.2 2007/06/04 18:19:27 christos Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)strcat.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: strcat.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
+__RCSID("$NetBSD: strcat.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -45,10 +45,12 @@ __RCSID("$NetBSD: strcat.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
#include <lib/libkern/libkern.h>
#endif
+#ifdef _FORTIFY_SOURCE
+#undef strcat
+#endif
+
char *
-strcat(s, append)
- char *s;
- const char *append;
+strcat(char *s, const char *append)
{
char *t = s;
diff --git a/common/lib/libc/string/strchr.c b/common/lib/libc/string/strchr.c
index d2f91690dc3..3feccfdf229 100644
--- a/common/lib/libc/string/strchr.c
+++ b/common/lib/libc/string/strchr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strchr.c,v 1.1 2005/12/20 19:28:52 christos Exp $ */
+/* $NetBSD: strchr.c,v 1.2 2007/06/04 18:19:27 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)index.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: strchr.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
+__RCSID("$NetBSD: strchr.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -48,11 +48,10 @@ __RCSID("$NetBSD: strchr.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
char *
#ifdef INDEX
-index(p, ch)
+index(const char *p, int ch)
#else
-strchr(p, ch)
+strchr(const char *p, int ch)
#endif
- const char *p, ch;
{
_DIAGASSERT(p != NULL);
diff --git a/common/lib/libc/string/strcmp.c b/common/lib/libc/string/strcmp.c
index c7acebee474..e17aab2dbae 100644
--- a/common/lib/libc/string/strcmp.c
+++ b/common/lib/libc/string/strcmp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strcmp.c,v 1.1 2005/12/20 19:28:52 christos Exp $ */
+/* $NetBSD: strcmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)strcmp.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: strcmp.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
+__RCSID("$NetBSD: strcmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -52,8 +52,7 @@ __RCSID("$NetBSD: strcmp.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
* Compare strings.
*/
int
-strcmp(s1, s2)
- const char *s1, *s2;
+strcmp(const char *s1, const char *s2)
{
_DIAGASSERT(s1 != NULL);
diff --git a/common/lib/libc/string/strcpy.c b/common/lib/libc/string/strcpy.c
index bfc9c7879fd..f7dfb58fd65 100644
--- a/common/lib/libc/string/strcpy.c
+++ b/common/lib/libc/string/strcpy.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strcpy.c,v 1.1 2005/12/20 19:28:52 christos Exp $ */
+/* $NetBSD: strcpy.c,v 1.2 2007/06/04 18:19:27 christos Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)strcpy.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: strcpy.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
+__RCSID("$NetBSD: strcpy.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -45,10 +45,12 @@ __RCSID("$NetBSD: strcpy.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
#include <lib/libkern/libkern.h>
#endif
+#ifdef _FORTIFY_SOURCE
+#undef strcpy
+#endif
+
char *
-strcpy(to, from)
- char *to;
- const char *from;
+strcpy(char *to, const char *from)
{
char *save = to;
diff --git a/common/lib/libc/string/strlcat.c b/common/lib/libc/string/strlcat.c
index b2d19f9180c..d4a8d7eba02 100644
--- a/common/lib/libc/string/strlcat.c
+++ b/common/lib/libc/string/strlcat.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strlcat.c,v 1.2 2006/03/30 20:37:51 christos Exp $ */
+/* $NetBSD: strlcat.c,v 1.3 2007/06/04 18:19:27 christos Exp $ */
/* $OpenBSD: strlcat.c,v 1.10 2003/04/12 21:56:39 millert Exp $ */
/*
@@ -24,7 +24,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: strlcat.c,v 1.2 2006/03/30 20:37:51 christos Exp $");
+__RCSID("$NetBSD: strlcat.c,v 1.3 2007/06/04 18:19:27 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#ifdef _LIBC
@@ -53,10 +53,7 @@ __weak_alias(strlcat, _strlcat)
* If retval >= siz, truncation occurred.
*/
size_t
-strlcat(dst, src, siz)
- char *dst;
- const char *src;
- size_t siz;
+strlcat(char *dst, const char *src, size_t siz)
{
char *d = dst;
const char *s = src;
diff --git a/common/lib/libc/string/strlcpy.c b/common/lib/libc/string/strlcpy.c
index 338fa4bb4f0..fbb5f4dd2e8 100644
--- a/common/lib/libc/string/strlcpy.c
+++ b/common/lib/libc/string/strlcpy.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strlcpy.c,v 1.2 2006/03/30 20:37:51 christos Exp $ */
+/* $NetBSD: strlcpy.c,v 1.3 2007/06/04 18:19:27 christos Exp $ */
/* $OpenBSD: strlcpy.c,v 1.7 2003/04/12 21:56:39 millert Exp $ */
/*
@@ -24,7 +24,7 @@
#include <sys/cdefs.h>
#if defined(LIBC_SCCS) && !defined(lint)
-__RCSID("$NetBSD: strlcpy.c,v 1.2 2006/03/30 20:37:51 christos Exp $");
+__RCSID("$NetBSD: strlcpy.c,v 1.3 2007/06/04 18:19:27 christos Exp $");
#endif /* LIBC_SCCS and not lint */
#ifdef _LIBC
@@ -51,10 +51,7 @@ __weak_alias(strlcpy, _strlcpy)
* Returns strlen(src); if retval >= siz, truncation occurred.
*/
size_t
-strlcpy(dst, src, siz)
- char *dst;
- const char *src;
- size_t siz;
+strlcpy(char *dst, const char *src, size_t siz)
{
char *d = dst;
const char *s = src;
diff --git a/common/lib/libc/string/strlen.c b/common/lib/libc/string/strlen.c
index 9cb8a778686..84195a3fa71 100644
--- a/common/lib/libc/string/strlen.c
+++ b/common/lib/libc/string/strlen.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strlen.c,v 1.1 2005/12/20 19:28:52 christos Exp $ */
+/* $NetBSD: strlen.c,v 1.2 2007/06/04 18:19:27 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)strlen.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: strlen.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
+__RCSID("$NetBSD: strlen.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -46,8 +46,7 @@ __RCSID("$NetBSD: strlen.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
#endif
size_t
-strlen(str)
- const char *str;
+strlen(const char *str)
{
const char *s;
diff --git a/common/lib/libc/string/strncasecmp.c b/common/lib/libc/string/strncasecmp.c
index b0dc9a26f47..e58a5daf1e0 100644
--- a/common/lib/libc/string/strncasecmp.c
+++ b/common/lib/libc/string/strncasecmp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strncasecmp.c,v 1.1 2005/12/20 19:28:52 christos Exp $ */
+/* $NetBSD: strncasecmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $ */
/*
* Copyright (c) 1987, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: strncasecmp.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
+__RCSID("$NetBSD: strncasecmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -53,9 +53,7 @@ __weak_alias(strncasecmp,_strncasecmp)
#endif
int
-strncasecmp(s1, s2, n)
- const char *s1, *s2;
- size_t n;
+strncasecmp(const char *s1, const char *s2, size_t n)
{
_DIAGASSERT(s1 != NULL);
diff --git a/common/lib/libc/string/strncmp.c b/common/lib/libc/string/strncmp.c
index f6014bbdab4..105e9149c3f 100644
--- a/common/lib/libc/string/strncmp.c
+++ b/common/lib/libc/string/strncmp.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strncmp.c,v 1.1 2005/12/20 19:28:52 christos Exp $ */
+/* $NetBSD: strncmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $ */
/*
* Copyright (c) 1989, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)strncmp.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: strncmp.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
+__RCSID("$NetBSD: strncmp.c,v 1.2 2007/06/04 18:19:27 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -46,9 +46,7 @@ __RCSID("$NetBSD: strncmp.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
#endif
int
-strncmp(s1, s2, n)
- const char *s1, *s2;
- size_t n;
+strncmp(const char *s1, const char *s2, size_t n)
{
_DIAGASSERT(s1 != NULL);
diff --git a/common/lib/libc/string/strncpy.c b/common/lib/libc/string/strncpy.c
index e452ce9a39a..afed6c039ca 100644
--- a/common/lib/libc/string/strncpy.c
+++ b/common/lib/libc/string/strncpy.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strncpy.c,v 1.2 2007/06/03 17:39:26 christos Exp $ */
+/* $NetBSD: strncpy.c,v 1.3 2007/06/04 18:19:28 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)strncpy.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: strncpy.c,v 1.2 2007/06/03 17:39:26 christos Exp $");
+__RCSID("$NetBSD: strncpy.c,v 1.3 2007/06/04 18:19:28 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -57,10 +57,7 @@ __RCSID("$NetBSD: strncpy.c,v 1.2 2007/06/03 17:39:26 christos Exp $");
* Return dst.
*/
char *
-strncpy(dst, src, n)
- char *dst;
- const char *src;
- size_t n;
+strncpy(char *dst, const char *src, size_t n)
{
_DIAGASSERT(dst != NULL);
diff --git a/common/lib/libc/string/strrchr.c b/common/lib/libc/string/strrchr.c
index 45307b874bd..6dd0961050f 100644
--- a/common/lib/libc/string/strrchr.c
+++ b/common/lib/libc/string/strrchr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strrchr.c,v 1.2 2006/03/13 15:41:46 martin Exp $ */
+/* $NetBSD: strrchr.c,v 1.3 2007/06/04 18:19:28 christos Exp $ */
/*
* Copyright (c) 1988, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)rindex.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: strrchr.c,v 1.2 2006/03/13 15:41:46 martin Exp $");
+__RCSID("$NetBSD: strrchr.c,v 1.3 2007/06/04 18:19:28 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -47,12 +47,10 @@ __RCSID("$NetBSD: strrchr.c,v 1.2 2006/03/13 15:41:46 martin Exp $");
char *
#ifdef RINDEX
-rindex(p, ch)
+rindex(const char *p, int ch)
#else
-strrchr(p, ch)
+strrchr(const char *p, int ch)
#endif
- const char *p;
- int ch;
{
char *save, c;
diff --git a/common/lib/libc/string/strsep.c b/common/lib/libc/string/strsep.c
index 3c7cdb5e9ed..7972b32e64a 100644
--- a/common/lib/libc/string/strsep.c
+++ b/common/lib/libc/string/strsep.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strsep.c,v 1.2 2007/02/19 18:33:09 chs Exp $ */
+/* $NetBSD: strsep.c,v 1.3 2007/06/04 18:19:28 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -34,7 +34,7 @@
#if 0
static char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: strsep.c,v 1.2 2007/02/19 18:33:09 chs Exp $");
+__RCSID("$NetBSD: strsep.c,v 1.3 2007/06/04 18:19:28 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -66,9 +66,7 @@ __weak_alias(strsep,_strsep)
* If *stringp is NULL, strsep returns NULL.
*/
char *
-strsep(stringp, delim)
- char **stringp;
- const char *delim;
+strsep(char **stringp, const char *delim)
{
char *s;
const char *spanp;
diff --git a/common/lib/libc/string/strstr.c b/common/lib/libc/string/strstr.c
index 56c4612147e..c2fa47d3e62 100644
--- a/common/lib/libc/string/strstr.c
+++ b/common/lib/libc/string/strstr.c
@@ -1,4 +1,4 @@
-/* $NetBSD: strstr.c,v 1.1 2005/12/20 19:28:52 christos Exp $ */
+/* $NetBSD: strstr.c,v 1.2 2007/06/04 18:19:28 christos Exp $ */
/*-
* Copyright (c) 1990, 1993
@@ -37,7 +37,7 @@
#if 0
static char sccsid[] = "@(#)strstr.c 8.1 (Berkeley) 6/4/93";
#else
-__RCSID("$NetBSD: strstr.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
+__RCSID("$NetBSD: strstr.c,v 1.2 2007/06/04 18:19:28 christos Exp $");
#endif
#endif /* LIBC_SCCS and not lint */
@@ -53,8 +53,7 @@ __RCSID("$NetBSD: strstr.c,v 1.1 2005/12/20 19:28:52 christos Exp $");
* Find the first occurrence of find in s.
*/
char *
-strstr(s, find)
- const char *s, *find;
+strstr(const char *s, const char *find)
{
char c, sc;
size_t len;