diff options
| author | lukem <lukem@NetBSD.org> | 1999-09-20 04:38:56 +0000 |
|---|---|---|
| committer | lukem <lukem@NetBSD.org> | 1999-09-20 04:38:56 +0000 |
| commit | d896261208b4610b0c4e86ea95caad3cdc86a4ac (patch) | |
| tree | 9a96db945c9ffba191e3aa4d741cf5d30fbd30f2 /lib/libc/string | |
| parent | f6ae64deff8e64a1acb3e1536bf6b6d06f7bffb9 (diff) | |
back out the #ifdef _DIAGNOSTIC argument checks; too many people complained.
_DIAGASSERT() is still retained.
Diffstat (limited to 'lib/libc/string')
33 files changed, 66 insertions, 212 deletions
diff --git a/lib/libc/string/__strerror.c b/lib/libc/string/__strerror.c index 8c0f81bb63e..59cee14a006 100644 --- a/lib/libc/string/__strerror.c +++ b/lib/libc/string/__strerror.c @@ -1,4 +1,4 @@ -/* $NetBSD: __strerror.c,v 1.15 1999/09/16 11:45:37 lukem Exp $ */ +/* $NetBSD: __strerror.c,v 1.16 1999/09/20 04:39:43 lukem Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. @@ -38,7 +38,7 @@ #if 0 static char *sccsid = "@(#)strerror.c 5.6 (Berkeley) 5/4/91"; #else -__RCSID("$NetBSD: __strerror.c,v 1.15 1999/09/16 11:45:37 lukem Exp $"); +__RCSID("$NetBSD: __strerror.c,v 1.16 1999/09/20 04:39:43 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -74,10 +74,6 @@ __strerror(num, buf, buflen) catd = catopen("libc", 0); #endif _DIAGASSERT(buf != NULL); -#ifdef _DIAGNOSTIC - if (buf == NULL) - return (NULL); -#endif errnum = num; /* convert to unsigned */ if (errnum < sys_nerr) { diff --git a/lib/libc/string/__strsignal.c b/lib/libc/string/__strsignal.c index 099cd3dbb93..bb457168542 100644 --- a/lib/libc/string/__strsignal.c +++ b/lib/libc/string/__strsignal.c @@ -1,4 +1,4 @@ -/* $NetBSD: __strsignal.c,v 1.18 1999/09/16 11:45:38 lukem Exp $ */ +/* $NetBSD: __strsignal.c,v 1.19 1999/09/20 04:39:44 lukem Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. @@ -38,7 +38,7 @@ #if 0 static char *sccsid = "@(#)strerror.c 5.6 (Berkeley) 5/4/91"; #else -__RCSID("$NetBSD: __strsignal.c,v 1.18 1999/09/16 11:45:38 lukem Exp $"); +__RCSID("$NetBSD: __strsignal.c,v 1.19 1999/09/20 04:39:44 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -70,10 +70,6 @@ __strsignal(num, buf, buflen) #endif _DIAGASSERT(buf != NULL); -#ifdef _DIAGNOSTIC - if (buf == NULL) - return (NULL); -#endif signum = num; /* convert to unsigned */ if (signum < sys_nsig) { diff --git a/lib/libc/string/bcmp.c b/lib/libc/string/bcmp.c index 0f06a1395c6..fc61d9023cd 100644 --- a/lib/libc/string/bcmp.c +++ b/lib/libc/string/bcmp.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcmp.c,v 1.12 1999/09/16 11:45:38 lukem Exp $ */ +/* $NetBSD: bcmp.c,v 1.13 1999/09/20 04:39:44 lukem Exp $ */ /* * Copyright (c) 1987, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)bcmp.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: bcmp.c,v 1.12 1999/09/16 11:45:38 lukem Exp $"); +__RCSID("$NetBSD: bcmp.c,v 1.13 1999/09/20 04:39:44 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -63,10 +63,6 @@ bcmp(b1, b2, length) _DIAGASSERT(b1 != 0); _DIAGASSERT(b2 != 0); -#ifdef _DIAGNOSTIC - if (b1 == 0 || b2 == 0) - return(0); -#endif if (length == 0) return(0); diff --git a/lib/libc/string/bcopy.c b/lib/libc/string/bcopy.c index b47369acf98..efa2145394e 100644 --- a/lib/libc/string/bcopy.c +++ b/lib/libc/string/bcopy.c @@ -1,4 +1,4 @@ -/* $NetBSD: bcopy.c,v 1.11 1999/09/16 11:45:38 lukem Exp $ */ +/* $NetBSD: bcopy.c,v 1.12 1999/09/20 04:39:44 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)bcopy.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: bcopy.c,v 1.11 1999/09/16 11:45:38 lukem Exp $"); +__RCSID("$NetBSD: bcopy.c,v 1.12 1999/09/20 04:39:44 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -89,12 +89,6 @@ bcopy(src0, dst0, length) _DIAGASSERT(dst0 != 0); _DIAGASSERT(src0 != 0); -#ifdef _DIAGNOSTIC - if (dst0 == 0 || src0 == 0) { - dst0 = 0; - goto done; - } -#endif if (length == 0 || dst == src) /* nothing to do */ goto done; diff --git a/lib/libc/string/bm.c b/lib/libc/string/bm.c index 916f9492c38..b281cd32f5c 100644 --- a/lib/libc/string/bm.c +++ b/lib/libc/string/bm.c @@ -1,4 +1,4 @@ -/* $NetBSD: bm.c,v 1.8 1999/09/16 11:45:38 lukem Exp $ */ +/* $NetBSD: bm.c,v 1.9 1999/09/20 04:39:44 lukem Exp $ */ /*- * Copyright (c) 1994 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)bm.c 8.7 (Berkeley) 6/21/94"; #else -__RCSID("$NetBSD: bm.c,v 1.8 1999/09/16 11:45:38 lukem Exp $"); +__RCSID("$NetBSD: bm.c,v 1.9 1999/09/20 04:39:44 lukem Exp $"); #endif #endif /* LIBC_SCCS && not lint */ @@ -117,12 +117,6 @@ bm_comp(pb, len, freq) _DIAGASSERT(pb != NULL); /* freq may be NULL */ -#ifdef _DIAGNOSTIC - if (pb == NULL) { - errno = EFAULT; - return (NULL); - } -#endif if (len == 0) { errno = EINVAL; @@ -175,10 +169,6 @@ bm_free(pat) { _DIAGASSERT(pat != NULL); -#ifdef _DIAGNOSTIC - if (pat == NULL) - return; -#endif if (pat->pat != NULL) free(pat->pat); @@ -199,10 +189,6 @@ bm_exec(pat, base, n) _DIAGASSERT(pat != NULL); _DIAGASSERT(base != NULL); -#ifdef _DIAGNOSTIC - if (pat == NULL || base == NULL) - return (NULL); -#endif if (n == 0) return (NULL); diff --git a/lib/libc/string/index.c b/lib/libc/string/index.c index 4aec46fa136..030502ce9bb 100644 --- a/lib/libc/string/index.c +++ b/lib/libc/string/index.c @@ -1,4 +1,4 @@ -/* $NetBSD: index.c,v 1.10 1999/09/16 11:45:40 lukem Exp $ */ +/* $NetBSD: index.c,v 1.11 1999/09/20 04:39:44 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)index.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: index.c,v 1.10 1999/09/16 11:45:40 lukem Exp $"); +__RCSID("$NetBSD: index.c,v 1.11 1999/09/20 04:39:44 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -61,10 +61,6 @@ index(p, ch) const char *p, ch; { _DIAGASSERT(p != NULL); -#ifdef _DIAGNOSTIC - if (p == NULL) - return (NULL); -#endif for (;; ++p) { if (*p == ch) diff --git a/lib/libc/string/memccpy.c b/lib/libc/string/memccpy.c index a62dd419a0b..8c4da6e3063 100644 --- a/lib/libc/string/memccpy.c +++ b/lib/libc/string/memccpy.c @@ -1,4 +1,4 @@ -/* $NetBSD: memccpy.c,v 1.10 1999/09/16 11:45:40 lukem Exp $ */ +/* $NetBSD: memccpy.c,v 1.11 1999/09/20 04:39:45 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)memccpy.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: memccpy.c,v 1.10 1999/09/16 11:45:40 lukem Exp $"); +__RCSID("$NetBSD: memccpy.c,v 1.11 1999/09/20 04:39:45 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -55,10 +55,6 @@ memccpy(t, f, c, n) _DIAGASSERT(t != 0); _DIAGASSERT(f != 0); -#ifdef _DIAGNOSTIC - if (t == 0 || f == 0) - return (0); -#endif if (n) { unsigned char *tp = t; diff --git a/lib/libc/string/memchr.c b/lib/libc/string/memchr.c index 220a5fe479c..e4df6101279 100644 --- a/lib/libc/string/memchr.c +++ b/lib/libc/string/memchr.c @@ -1,4 +1,4 @@ -/* $NetBSD: memchr.c,v 1.10 1999/09/16 11:45:40 lukem Exp $ */ +/* $NetBSD: memchr.c,v 1.11 1999/09/20 04:39:45 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)memchr.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: memchr.c,v 1.10 1999/09/16 11:45:40 lukem Exp $"); +__RCSID("$NetBSD: memchr.c,v 1.11 1999/09/20 04:39:45 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -61,10 +61,6 @@ memchr(s, c, n) size_t n; { _DIAGASSERT(s != NULL); -#ifdef _DIAGNOSTIC - if (s == NULL) - return (NULL); -#endif if (n != 0) { const unsigned char *p = s; diff --git a/lib/libc/string/memcmp.c b/lib/libc/string/memcmp.c index b9640fe2833..9e70bd17289 100644 --- a/lib/libc/string/memcmp.c +++ b/lib/libc/string/memcmp.c @@ -1,4 +1,4 @@ -/* $NetBSD: memcmp.c,v 1.10 1999/09/16 11:45:40 lukem Exp $ */ +/* $NetBSD: memcmp.c,v 1.11 1999/09/20 04:39:45 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)memcmp.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: memcmp.c,v 1.10 1999/09/16 11:45:40 lukem Exp $"); +__RCSID("$NetBSD: memcmp.c,v 1.11 1999/09/20 04:39:45 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -63,10 +63,6 @@ memcmp(s1, s2, n) { _DIAGASSERT(s1 != 0); _DIAGASSERT(s2 != 0); -#ifdef _DIAGNOSTIC - if (s1 == 0 || s2 == 0) - return (0); -#endif if (n != 0) { const unsigned char *p1 = s1, *p2 = s2; diff --git a/lib/libc/string/memset.c b/lib/libc/string/memset.c index 79c62706def..7beb50f46d4 100644 --- a/lib/libc/string/memset.c +++ b/lib/libc/string/memset.c @@ -1,4 +1,4 @@ -/* $NetBSD: memset.c,v 1.13 1999/09/16 11:45:40 lukem Exp $ */ +/* $NetBSD: memset.c,v 1.14 1999/09/20 04:39:45 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)memset.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: memset.c,v 1.13 1999/09/16 11:45:40 lukem Exp $"); +__RCSID("$NetBSD: memset.c,v 1.14 1999/09/20 04:39:45 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -88,10 +88,6 @@ memset(dst0, c0, length) u_char *dst; _DIAGASSERT(dst0 != 0); -#ifdef _DIAGNOSTIC - if (dst0 == 0) - RETURN; -#endif dst = dst0; /* diff --git a/lib/libc/string/rindex.c b/lib/libc/string/rindex.c index 8faa5348ffc..359d92d02bd 100644 --- a/lib/libc/string/rindex.c +++ b/lib/libc/string/rindex.c @@ -1,4 +1,4 @@ -/* $NetBSD: rindex.c,v 1.10 1999/09/16 11:45:40 lukem Exp $ */ +/* $NetBSD: rindex.c,v 1.11 1999/09/20 04:39:45 lukem Exp $ */ /* * Copyright (c) 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)rindex.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: rindex.c,v 1.10 1999/09/16 11:45:40 lukem Exp $"); +__RCSID("$NetBSD: rindex.c,v 1.11 1999/09/20 04:39:45 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -63,10 +63,6 @@ rindex(p, ch) char *save; _DIAGASSERT(p != NULL); -#ifdef _DIAGNOSTIC - if (p == NULL) - return (NULL); -#endif for (save = NULL;; ++p) { if (*p == ch) diff --git a/lib/libc/string/strcasecmp.c b/lib/libc/string/strcasecmp.c index fc903554899..4f9816a5c4e 100644 --- a/lib/libc/string/strcasecmp.c +++ b/lib/libc/string/strcasecmp.c @@ -1,4 +1,4 @@ -/* $NetBSD: strcasecmp.c,v 1.10 1999/09/16 11:45:41 lukem Exp $ */ +/* $NetBSD: strcasecmp.c,v 1.11 1999/09/20 04:39:45 lukem Exp $ */ /* * Copyright (c) 1987, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)strcasecmp.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strcasecmp.c,v 1.10 1999/09/16 11:45:41 lukem Exp $"); +__RCSID("$NetBSD: strcasecmp.c,v 1.11 1999/09/20 04:39:45 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -63,10 +63,6 @@ strcasecmp(s1, s2) _DIAGASSERT(s1 != NULL); _DIAGASSERT(s2 != NULL); -#ifdef _DIAGNOSTIC - if (s1 == NULL || s2 == NULL) - return (0); -#endif while (tolower(*us1) == tolower(*us2++)) if (*us1++ == '\0') diff --git a/lib/libc/string/strcat.c b/lib/libc/string/strcat.c index c4191102d26..812e07271a0 100644 --- a/lib/libc/string/strcat.c +++ b/lib/libc/string/strcat.c @@ -1,4 +1,4 @@ -/* $NetBSD: strcat.c,v 1.11 1999/09/16 11:45:41 lukem Exp $ */ +/* $NetBSD: strcat.c,v 1.12 1999/09/20 04:39:46 lukem Exp $ */ /* * Copyright (c) 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)strcat.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strcat.c,v 1.11 1999/09/16 11:45:41 lukem Exp $"); +__RCSID("$NetBSD: strcat.c,v 1.12 1999/09/20 04:39:46 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -60,10 +60,6 @@ strcat(s, append) _DIAGASSERT(t != NULL); _DIAGASSERT(append != NULL); -#ifdef _DIAGNOSTIC - if (t == NULL || append == NULL) - return (NULL); -#endif for (; *t; ++t) ; diff --git a/lib/libc/string/strcmp.c b/lib/libc/string/strcmp.c index 6b9bdaaa5f1..a1ddae12174 100644 --- a/lib/libc/string/strcmp.c +++ b/lib/libc/string/strcmp.c @@ -1,4 +1,4 @@ -/* $NetBSD: strcmp.c,v 1.11 1999/09/16 11:45:41 lukem Exp $ */ +/* $NetBSD: strcmp.c,v 1.12 1999/09/20 04:39:46 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)strcmp.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strcmp.c,v 1.11 1999/09/16 11:45:41 lukem Exp $"); +__RCSID("$NetBSD: strcmp.c,v 1.12 1999/09/20 04:39:46 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -64,10 +64,6 @@ strcmp(s1, s2) _DIAGASSERT(s1 != NULL); _DIAGASSERT(s2 != NULL); -#ifdef _DIAGNOSTIC - if (s1 == NULL || s2 == NULL) - return (0); -#endif while (*s1 == *s2++) if (*s1++ == 0) diff --git a/lib/libc/string/strcoll.c b/lib/libc/string/strcoll.c index cd7436e382f..0e9dbb16bec 100644 --- a/lib/libc/string/strcoll.c +++ b/lib/libc/string/strcoll.c @@ -1,4 +1,4 @@ -/* $NetBSD: strcoll.c,v 1.7 1999/09/16 11:45:41 lukem Exp $ */ +/* $NetBSD: strcoll.c,v 1.8 1999/09/20 04:39:46 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)strcoll.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strcoll.c,v 1.7 1999/09/16 11:45:41 lukem Exp $"); +__RCSID("$NetBSD: strcoll.c,v 1.8 1999/09/20 04:39:46 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -58,10 +58,6 @@ strcoll(s1, s2) _DIAGASSERT(s1 != NULL); _DIAGASSERT(s2 != NULL); -#ifdef _DIAGNOSTIC - if (s1 == NULL || s2 == NULL) - return (0); -#endif /* LC_COLLATE is unimplemented, hence always "C" */ return (strcmp(s1, s2)); diff --git a/lib/libc/string/strcpy.c b/lib/libc/string/strcpy.c index cd42a18e524..bf011609f16 100644 --- a/lib/libc/string/strcpy.c +++ b/lib/libc/string/strcpy.c @@ -1,4 +1,4 @@ -/* $NetBSD: strcpy.c,v 1.11 1999/09/16 11:45:41 lukem Exp $ */ +/* $NetBSD: strcpy.c,v 1.12 1999/09/20 04:39:46 lukem Exp $ */ /* * Copyright (c) 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)strcpy.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strcpy.c,v 1.11 1999/09/16 11:45:41 lukem Exp $"); +__RCSID("$NetBSD: strcpy.c,v 1.12 1999/09/20 04:39:46 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -60,10 +60,6 @@ strcpy(to, from) _DIAGASSERT(to != NULL); _DIAGASSERT(from != NULL); -#ifdef _DIAGNOSTIC - if (to == NULL || from == NULL) - return (NULL); -#endif for (; (*to = *from) != '\0'; ++from, ++to); return(save); diff --git a/lib/libc/string/strcspn.c b/lib/libc/string/strcspn.c index 916b05ae9ac..4a172ab35ce 100644 --- a/lib/libc/string/strcspn.c +++ b/lib/libc/string/strcspn.c @@ -1,4 +1,4 @@ -/* $NetBSD: strcspn.c,v 1.8 1999/09/16 11:45:41 lukem Exp $ */ +/* $NetBSD: strcspn.c,v 1.9 1999/09/20 04:39:46 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)strcspn.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strcspn.c,v 1.8 1999/09/16 11:45:41 lukem Exp $"); +__RCSID("$NetBSD: strcspn.c,v 1.9 1999/09/20 04:39:46 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -61,10 +61,6 @@ strcspn(s1, s2) _DIAGASSERT(s1 != NULL); _DIAGASSERT(s2 != NULL); -#ifdef _DIAGNOSTIC - if (s1 == NULL || s2 == NULL) - return (0); -#endif /* * Stop as soon as we find any character from s2. Note that there diff --git a/lib/libc/string/strdup.c b/lib/libc/string/strdup.c index fc8cd9afca4..1de9ad45ac0 100644 --- a/lib/libc/string/strdup.c +++ b/lib/libc/string/strdup.c @@ -1,4 +1,4 @@ -/* $NetBSD: strdup.c,v 1.10 1999/09/16 11:45:41 lukem Exp $ */ +/* $NetBSD: strdup.c,v 1.11 1999/09/20 04:39:46 lukem Exp $ */ /* * Copyright (c) 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)strdup.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strdup.c,v 1.10 1999/09/16 11:45:41 lukem Exp $"); +__RCSID("$NetBSD: strdup.c,v 1.11 1999/09/20 04:39:46 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -61,12 +61,6 @@ strdup(str) char *copy; _DIAGASSERT(str != NULL); -#ifdef _DIAGNOSTIC - if (str == NULL) { - errno = EFAULT; - return (NULL); - } -#endif len = strlen(str) + 1; if (!(copy = malloc(len))) diff --git a/lib/libc/string/strlcat.c b/lib/libc/string/strlcat.c index 78f8a0e3a86..29f67b4bb34 100644 --- a/lib/libc/string/strlcat.c +++ b/lib/libc/string/strlcat.c @@ -1,4 +1,4 @@ -/* $NetBSD: strlcat.c,v 1.4 1999/09/16 11:45:41 lukem Exp $ */ +/* $NetBSD: strlcat.c,v 1.5 1999/09/20 04:39:47 lukem Exp $ */ /* from OpenBSD: strlcat.c,v 1.2 1999/06/17 16:28:58 millert Exp */ /* @@ -30,7 +30,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: strlcat.c,v 1.4 1999/09/16 11:45:41 lukem Exp $"); +__RCSID("$NetBSD: strlcat.c,v 1.5 1999/09/20 04:39:47 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -56,10 +56,6 @@ strlcat(dst, src, siz) _DIAGASSERT(dst != NULL); _DIAGASSERT(src != NULL); -#ifdef _DIAGNOSTIC - if (dst == NULL || src == NULL) - return (0); -#endif /* Find the end of dst and adjust bytes left but don't go past end */ while (*d != '\0' && n-- != 0) diff --git a/lib/libc/string/strlcpy.c b/lib/libc/string/strlcpy.c index 58cd488029e..6d19a732439 100644 --- a/lib/libc/string/strlcpy.c +++ b/lib/libc/string/strlcpy.c @@ -1,4 +1,4 @@ -/* $NetBSD: strlcpy.c,v 1.4 1999/09/16 11:45:42 lukem Exp $ */ +/* $NetBSD: strlcpy.c,v 1.5 1999/09/20 04:39:47 lukem Exp $ */ /* from OpenBSD: strlcpy.c,v 1.4 1999/05/01 18:56:41 millert Exp */ /* @@ -30,7 +30,7 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: strlcpy.c,v 1.4 1999/09/16 11:45:42 lukem Exp $"); +__RCSID("$NetBSD: strlcpy.c,v 1.5 1999/09/20 04:39:47 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ #include <sys/types.h> @@ -54,10 +54,6 @@ strlcpy(dst, src, siz) _DIAGASSERT(dst != NULL); _DIAGASSERT(src != NULL); -#ifdef _DIAGNOSTIC - if (dst == NULL || src == NULL) - return (0); -#endif /* Copy as many bytes as will fit */ if (n != 0 && --n != 0) { diff --git a/lib/libc/string/strlen.c b/lib/libc/string/strlen.c index 9e2de24b840..aabd2c14c5e 100644 --- a/lib/libc/string/strlen.c +++ b/lib/libc/string/strlen.c @@ -1,4 +1,4 @@ -/* $NetBSD: strlen.c,v 1.10 1999/09/16 11:45:42 lukem Exp $ */ +/* $NetBSD: strlen.c,v 1.11 1999/09/20 04:39:47 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)strlen.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strlen.c,v 1.10 1999/09/16 11:45:42 lukem Exp $"); +__RCSID("$NetBSD: strlen.c,v 1.11 1999/09/20 04:39:47 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -58,10 +58,6 @@ strlen(str) const char *s; _DIAGASSERT(str != NULL); -#ifdef _DIAGNOSTIC - if (str == NULL) - return (0); -#endif for (s = str; *s; ++s); return(s - str); diff --git a/lib/libc/string/strmode.c b/lib/libc/string/strmode.c index 5c442c3e4ce..3ff021f481a 100644 --- a/lib/libc/string/strmode.c +++ b/lib/libc/string/strmode.c @@ -1,4 +1,4 @@ -/* $NetBSD: strmode.c,v 1.10 1999/09/16 11:45:42 lukem Exp $ */ +/* $NetBSD: strmode.c,v 1.11 1999/09/20 04:39:47 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)strmode.c 8.3 (Berkeley) 8/15/94"; #else -__RCSID("$NetBSD: strmode.c,v 1.10 1999/09/16 11:45:42 lukem Exp $"); +__RCSID("$NetBSD: strmode.c,v 1.11 1999/09/20 04:39:47 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -55,10 +55,6 @@ strmode(mode, p) { _DIAGASSERT(p != NULL); -#ifdef _DIAGNOSTIC - if (p == NULL) - return; -#endif /* print type */ switch (mode & S_IFMT) { diff --git a/lib/libc/string/strncat.c b/lib/libc/string/strncat.c index baedf9b98db..d2257485859 100644 --- a/lib/libc/string/strncat.c +++ b/lib/libc/string/strncat.c @@ -1,4 +1,4 @@ -/* $NetBSD: strncat.c,v 1.8 1999/09/16 11:45:42 lukem Exp $ */ +/* $NetBSD: strncat.c,v 1.9 1999/09/20 04:39:47 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)strncat.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strncat.c,v 1.8 1999/09/16 11:45:42 lukem Exp $"); +__RCSID("$NetBSD: strncat.c,v 1.9 1999/09/20 04:39:47 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -61,10 +61,6 @@ strncat(dst, src, n) _DIAGASSERT(dst != NULL); _DIAGASSERT(src != NULL); -#ifdef _DIAGNOSTIC - if (dst == NULL || src == NULL) - return (NULL); -#endif if (n != 0) { char *d = dst; diff --git a/lib/libc/string/strncmp.c b/lib/libc/string/strncmp.c index 38e8bf4a15f..b32297dda12 100644 --- a/lib/libc/string/strncmp.c +++ b/lib/libc/string/strncmp.c @@ -1,4 +1,4 @@ -/* $NetBSD: strncmp.c,v 1.11 1999/09/16 11:45:42 lukem Exp $ */ +/* $NetBSD: strncmp.c,v 1.12 1999/09/20 04:39:48 lukem Exp $ */ /* * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)strncmp.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strncmp.c,v 1.11 1999/09/16 11:45:42 lukem Exp $"); +__RCSID("$NetBSD: strncmp.c,v 1.12 1999/09/20 04:39:48 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -59,10 +59,6 @@ strncmp(s1, s2, n) _DIAGASSERT(s1 != NULL); _DIAGASSERT(s2 != NULL); -#ifdef _DIAGNOSTIC - if (s1 == NULL || s2 == NULL) - return (0); -#endif if (n == 0) return (0); diff --git a/lib/libc/string/strncpy.c b/lib/libc/string/strncpy.c index 0da46ebf42e..68d774bb46a 100644 --- a/lib/libc/string/strncpy.c +++ b/lib/libc/string/strncpy.c @@ -1,4 +1,4 @@ -/* $NetBSD: strncpy.c,v 1.10 1999/09/16 11:45:42 lukem Exp $ */ +/* $NetBSD: strncpy.c,v 1.11 1999/09/20 04:39:48 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)strncpy.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strncpy.c,v 1.10 1999/09/16 11:45:42 lukem Exp $"); +__RCSID("$NetBSD: strncpy.c,v 1.11 1999/09/20 04:39:48 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -67,10 +67,6 @@ strncpy(dst, src, n) _DIAGASSERT(dst != NULL); _DIAGASSERT(src != NULL); -#ifdef _DIAGNOSTIC - if (dst == NULL || src == NULL) - return (NULL); -#endif if (n != 0) { char *d = dst; diff --git a/lib/libc/string/strpbrk.c b/lib/libc/string/strpbrk.c index a90201bea3e..9b0371f607a 100644 --- a/lib/libc/string/strpbrk.c +++ b/lib/libc/string/strpbrk.c @@ -1,4 +1,4 @@ -/* $NetBSD: strpbrk.c,v 1.9 1999/09/16 11:45:42 lukem Exp $ */ +/* $NetBSD: strpbrk.c,v 1.10 1999/09/20 04:39:48 lukem Exp $ */ /* * Copyright (c) 1985, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)strpbrk.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strpbrk.c,v 1.9 1999/09/16 11:45:42 lukem Exp $"); +__RCSID("$NetBSD: strpbrk.c,v 1.10 1999/09/20 04:39:48 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -57,10 +57,6 @@ strpbrk(s1, s2) _DIAGASSERT(s1 != NULL); _DIAGASSERT(s2 != NULL); -#ifdef _DIAGNOSTIC - if (s1 == NULL || s2 == NULL) - return (NULL); -#endif while ((c = *s1++) != 0) { for (scanp = s2; (sc = *scanp++) != 0;) diff --git a/lib/libc/string/strsep.c b/lib/libc/string/strsep.c index 58aa2e8d51e..51bcca0789a 100644 --- a/lib/libc/string/strsep.c +++ b/lib/libc/string/strsep.c @@ -1,4 +1,4 @@ -/* $NetBSD: strsep.c,v 1.9 1999/09/16 11:45:42 lukem Exp $ */ +/* $NetBSD: strsep.c,v 1.10 1999/09/20 04:39:48 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)strsep.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strsep.c,v 1.9 1999/09/16 11:45:42 lukem Exp $"); +__RCSID("$NetBSD: strsep.c,v 1.10 1999/09/20 04:39:48 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -74,10 +74,6 @@ strsep(stringp, delim) _DIAGASSERT(stringp != NULL); _DIAGASSERT(delim != NULL); -#ifdef _DIAGNOSTIC - if (stringp == NULL || delim == NULL) - return (NULL); -#endif if ((s = *stringp) == NULL) return (NULL); diff --git a/lib/libc/string/strspn.c b/lib/libc/string/strspn.c index 5958d140927..6b952b8de1f 100644 --- a/lib/libc/string/strspn.c +++ b/lib/libc/string/strspn.c @@ -1,4 +1,4 @@ -/* $NetBSD: strspn.c,v 1.8 1999/09/16 11:45:42 lukem Exp $ */ +/* $NetBSD: strspn.c,v 1.9 1999/09/20 04:39:48 lukem Exp $ */ /* * Copyright (c) 1989, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)strspn.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strspn.c,v 1.8 1999/09/16 11:45:42 lukem Exp $"); +__RCSID("$NetBSD: strspn.c,v 1.9 1999/09/20 04:39:48 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -58,10 +58,6 @@ strspn(s1, s2) _DIAGASSERT(s1 != NULL); _DIAGASSERT(s2 != NULL); -#ifdef _DIAGNOSTIC - if (s1 == NULL || s2 == NULL) - return (0); -#endif /* * Skip any characters in s2, excluding the terminating \0. diff --git a/lib/libc/string/strstr.c b/lib/libc/string/strstr.c index 24fab22985e..060decd17ae 100644 --- a/lib/libc/string/strstr.c +++ b/lib/libc/string/strstr.c @@ -1,4 +1,4 @@ -/* $NetBSD: strstr.c,v 1.9 1999/09/16 11:45:43 lukem Exp $ */ +/* $NetBSD: strstr.c,v 1.10 1999/09/20 04:39:48 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)strstr.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strstr.c,v 1.9 1999/09/16 11:45:43 lukem Exp $"); +__RCSID("$NetBSD: strstr.c,v 1.10 1999/09/20 04:39:48 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -60,10 +60,6 @@ strstr(s, find) _DIAGASSERT(s != NULL); _DIAGASSERT(find != NULL); -#ifdef _DIAGNOSTIC - if (s == NULL || find == NULL) - return (NULL); -#endif if ((c = *find++) != 0) { len = strlen(find); diff --git a/lib/libc/string/strtok.c b/lib/libc/string/strtok.c index d95c271996a..fc41f0f8213 100644 --- a/lib/libc/string/strtok.c +++ b/lib/libc/string/strtok.c @@ -1,4 +1,4 @@ -/* $NetBSD: strtok.c,v 1.9 1999/09/16 11:45:43 lukem Exp $ */ +/* $NetBSD: strtok.c,v 1.10 1999/09/20 04:39:49 lukem Exp $ */ /* * Copyright (c) 1988, 1993 @@ -38,7 +38,7 @@ #if 0 static char sccsid[] = "@(#)strtok.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strtok.c,v 1.9 1999/09/16 11:45:43 lukem Exp $"); +__RCSID("$NetBSD: strtok.c,v 1.10 1999/09/20 04:39:49 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -57,10 +57,6 @@ strtok(s, delim) /* s may be NULL */ _DIAGASSERT(delim != NULL); -#ifdef _DIAGNOSTIC - if (delim == NULL) - return (NULL); -#endif if (s == NULL && (s = last) == NULL) return (NULL); diff --git a/lib/libc/string/strtok_r.c b/lib/libc/string/strtok_r.c index 77a345ae699..19953dace5a 100644 --- a/lib/libc/string/strtok_r.c +++ b/lib/libc/string/strtok_r.c @@ -1,4 +1,4 @@ -/* $NetBSD: strtok_r.c,v 1.6 1999/09/16 11:45:43 lukem Exp $ */ +/* $NetBSD: strtok_r.c,v 1.7 1999/09/20 04:39:49 lukem Exp $ */ /* * Copyright (c) 1988 Regents of the University of California. @@ -38,7 +38,7 @@ #if 0 static char *sccsid = "@(#)strtok.c 5.8 (Berkeley) 2/24/91"; #else -__RCSID("$NetBSD: strtok_r.c,v 1.6 1999/09/16 11:45:43 lukem Exp $"); +__RCSID("$NetBSD: strtok_r.c,v 1.7 1999/09/20 04:39:49 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -64,10 +64,6 @@ strtok_r(s, delim, lasts) /* s may be NULL */ _DIAGASSERT(delim != NULL); _DIAGASSERT(lasts != NULL); -#ifdef _DIAGNOSTIC - if (delim == NULL || lasts == NULL) - return (NULL); -#endif if (s == NULL && (s = *lasts) == NULL) return (NULL); diff --git a/lib/libc/string/strxfrm.c b/lib/libc/string/strxfrm.c index ca5e2ac856a..d18ecd545d1 100644 --- a/lib/libc/string/strxfrm.c +++ b/lib/libc/string/strxfrm.c @@ -1,4 +1,4 @@ -/* $NetBSD: strxfrm.c,v 1.8 1999/09/16 11:45:43 lukem Exp $ */ +/* $NetBSD: strxfrm.c,v 1.9 1999/09/20 04:39:49 lukem Exp $ */ /*- * Copyright (c) 1990, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)strxfrm.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: strxfrm.c,v 1.8 1999/09/16 11:45:43 lukem Exp $"); +__RCSID("$NetBSD: strxfrm.c,v 1.9 1999/09/20 04:39:49 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -63,10 +63,6 @@ strxfrm(dst, src, n) _DIAGASSERT(src != NULL); _DIAGASSERT(dst != NULL); -#ifdef _DIAGNOSTIC - if (src == NULL || dst == NULL) - return (0); -#endif /* * Since locales are unimplemented, this is just a copy. diff --git a/lib/libc/string/swab.c b/lib/libc/string/swab.c index e2c08a39587..bb20f735c37 100644 --- a/lib/libc/string/swab.c +++ b/lib/libc/string/swab.c @@ -1,4 +1,4 @@ -/* $NetBSD: swab.c,v 1.8 1999/09/16 11:45:43 lukem Exp $ */ +/* $NetBSD: swab.c,v 1.9 1999/09/20 04:39:49 lukem Exp $ */ /* * Copyright (c) 1988, 1993 @@ -41,7 +41,7 @@ #if 0 static char sccsid[] = "@(#)swab.c 8.1 (Berkeley) 6/4/93"; #else -__RCSID("$NetBSD: swab.c,v 1.8 1999/09/16 11:45:43 lukem Exp $"); +__RCSID("$NetBSD: swab.c,v 1.9 1999/09/20 04:39:49 lukem Exp $"); #endif #endif /* LIBC_SCCS and not lint */ @@ -60,10 +60,6 @@ swab(from, to, len) _DIAGASSERT(from != NULL); _DIAGASSERT(to != NULL); -#ifdef _DIAGNOSTIC - if (from == NULL || to == NULL) - return; -#endif n = (len >> 1) + 1; fp = (char *)from; |
