diff options
| author | lukem <lukem@NetBSD.org> | 2001-01-03 14:29:36 +0000 |
|---|---|---|
| committer | lukem <lukem@NetBSD.org> | 2001-01-03 14:29:36 +0000 |
| commit | 5ba790cb50cfef45bfe89d903c0c42855588db95 (patch) | |
| tree | 5c73595c4e3ef8f28ee61b744e11d4f1cb9c51c7 /lib/libc/string | |
| parent | 0c55b7011c9e0922ccdc05cead51031905f064ed (diff) | |
sprinkle in _DIAGASSERT() as appropriate
Diffstat (limited to 'lib/libc/string')
| -rw-r--r-- | lib/libc/string/wcscat.c | 8 | ||||
| -rw-r--r-- | lib/libc/string/wcschr.c | 7 | ||||
| -rw-r--r-- | lib/libc/string/wcscmp.c | 8 | ||||
| -rw-r--r-- | lib/libc/string/wcscpy.c | 8 | ||||
| -rw-r--r-- | lib/libc/string/wcscspn.c | 8 | ||||
| -rw-r--r-- | lib/libc/string/wcslen.c | 7 | ||||
| -rw-r--r-- | lib/libc/string/wcsncat.c | 8 | ||||
| -rw-r--r-- | lib/libc/string/wcsncmp.c | 8 | ||||
| -rw-r--r-- | lib/libc/string/wcsncpy.c | 8 | ||||
| -rw-r--r-- | lib/libc/string/wcspbrk.c | 8 | ||||
| -rw-r--r-- | lib/libc/string/wcsrchr.c | 7 | ||||
| -rw-r--r-- | lib/libc/string/wcsspn.c | 8 | ||||
| -rw-r--r-- | lib/libc/string/wcsstr.c | 8 | ||||
| -rw-r--r-- | lib/libc/string/wcswidth.c | 7 | ||||
| -rw-r--r-- | lib/libc/string/wmemchr.c | 7 | ||||
| -rw-r--r-- | lib/libc/string/wmemcmp.c | 8 | ||||
| -rw-r--r-- | lib/libc/string/wmemcpy.c | 11 | ||||
| -rw-r--r-- | lib/libc/string/wmemmove.c | 11 | ||||
| -rw-r--r-- | lib/libc/string/wmemset.c | 7 |
19 files changed, 112 insertions, 40 deletions
diff --git a/lib/libc/string/wcscat.c b/lib/libc/string/wcscat.c index ec309b92d03..d3e6eb8f250 100644 --- a/lib/libc/string/wcscat.c +++ b/lib/libc/string/wcscat.c @@ -1,4 +1,4 @@ -/* $NetBSD: wcscat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */ +/* $NetBSD: wcscat.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wcscat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $"); +__RCSID("$NetBSD: wcscat.c,v 1.2 2001/01/03 14:29:36 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> wchar_t * @@ -44,6 +45,9 @@ wcscat(s1, s2) wchar_t *q; const wchar_t *r; + _DIAGASSERT(s1 != NULL); + _DIAGASSERT(s2 != NULL); + p = s1; while (*p) p++; diff --git a/lib/libc/string/wcschr.c b/lib/libc/string/wcschr.c index fedfc457a49..4c384b67313 100644 --- a/lib/libc/string/wcschr.c +++ b/lib/libc/string/wcschr.c @@ -1,4 +1,4 @@ -/* $NetBSD: wcschr.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */ +/* $NetBSD: wcschr.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wcschr.c,v 1.1 2000/12/23 23:14:36 itojun Exp $"); +__RCSID("$NetBSD: wcschr.c,v 1.2 2001/01/03 14:29:36 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> wchar_t * @@ -42,6 +43,8 @@ wcschr(s, c) { const wchar_t *p; + _DIAGASSERT(s != NULL); + p = s; while (*p) { if (*p == c) { diff --git a/lib/libc/string/wcscmp.c b/lib/libc/string/wcscmp.c index d72ae0bd186..841055eb9df 100644 --- a/lib/libc/string/wcscmp.c +++ b/lib/libc/string/wcscmp.c @@ -1,4 +1,4 @@ -/* $NetBSD: wcscmp.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */ +/* $NetBSD: wcscmp.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wcscmp.c,v 1.1 2000/12/23 23:14:36 itojun Exp $"); +__RCSID("$NetBSD: wcscmp.c,v 1.2 2001/01/03 14:29:36 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> int @@ -40,6 +41,9 @@ wcscmp(s1, s2) const wchar_t *s1; const wchar_t *s2; { + _DIAGASSERT(s1 != NULL); + _DIAGASSERT(s2 != NULL); + while (*s1 == *s2 && *s1) { s1++; s2++; diff --git a/lib/libc/string/wcscpy.c b/lib/libc/string/wcscpy.c index ad3eb2f9390..c78a8ab6d63 100644 --- a/lib/libc/string/wcscpy.c +++ b/lib/libc/string/wcscpy.c @@ -1,4 +1,4 @@ -/* $NetBSD: wcscpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */ +/* $NetBSD: wcscpy.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wcscpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $"); +__RCSID("$NetBSD: wcscpy.c,v 1.2 2001/01/03 14:29:36 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> wchar_t * @@ -43,6 +44,9 @@ wcscpy(s1, s2) wchar_t *p; const wchar_t *q; + _DIAGASSERT(s1 != NULL); + _DIAGASSERT(s2 != NULL); + *s1 = '\0'; p = s1; q = s2; diff --git a/lib/libc/string/wcscspn.c b/lib/libc/string/wcscspn.c index 60b2acf0f85..2fa09895ad9 100644 --- a/lib/libc/string/wcscspn.c +++ b/lib/libc/string/wcscspn.c @@ -1,4 +1,4 @@ -/* $NetBSD: wcscspn.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */ +/* $NetBSD: wcscspn.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wcscspn.c,v 1.1 2000/12/23 23:14:36 itojun Exp $"); +__RCSID("$NetBSD: wcscspn.c,v 1.2 2001/01/03 14:29:36 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> size_t @@ -43,6 +44,9 @@ wcscspn(s, set) const wchar_t *p; const wchar_t *q; + _DIAGASSERT(s != NULL); + _DIAGASSERT(set != NULL); + p = s; while (*p) { q = set; diff --git a/lib/libc/string/wcslen.c b/lib/libc/string/wcslen.c index 424a1be349b..c62c4594107 100644 --- a/lib/libc/string/wcslen.c +++ b/lib/libc/string/wcslen.c @@ -1,4 +1,4 @@ -/* $NetBSD: wcslen.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */ +/* $NetBSD: wcslen.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wcslen.c,v 1.1 2000/12/23 23:14:36 itojun Exp $"); +__RCSID("$NetBSD: wcslen.c,v 1.2 2001/01/03 14:29:36 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> size_t @@ -41,6 +42,8 @@ wcslen(s) { const wchar_t *p; + _DIAGASSERT(s != NULL); + p = s; while (*p) p++; diff --git a/lib/libc/string/wcsncat.c b/lib/libc/string/wcsncat.c index 909ede46e30..1fdca11645e 100644 --- a/lib/libc/string/wcsncat.c +++ b/lib/libc/string/wcsncat.c @@ -1,4 +1,4 @@ -/* $NetBSD: wcsncat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */ +/* $NetBSD: wcsncat.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wcsncat.c,v 1.1 2000/12/23 23:14:36 itojun Exp $"); +__RCSID("$NetBSD: wcsncat.c,v 1.2 2001/01/03 14:29:36 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> wchar_t * @@ -45,6 +46,9 @@ wcsncat(s1, s2, n) wchar_t *q; const wchar_t *r; + _DIAGASSERT(s1 != NULL); + _DIAGASSERT(s2 != NULL); + p = s1; while (*p) p++; diff --git a/lib/libc/string/wcsncmp.c b/lib/libc/string/wcsncmp.c index b00d0b360f3..2ebbef5cbe4 100644 --- a/lib/libc/string/wcsncmp.c +++ b/lib/libc/string/wcsncmp.c @@ -1,4 +1,4 @@ -/* $NetBSD: wcsncmp.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */ +/* $NetBSD: wcsncmp.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wcsncmp.c,v 1.1 2000/12/23 23:14:36 itojun Exp $"); +__RCSID("$NetBSD: wcsncmp.c,v 1.2 2001/01/03 14:29:37 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> int @@ -41,6 +42,9 @@ wcsncmp(s1, s2, n) const wchar_t *s2; size_t n; { + _DIAGASSERT(s1 != NULL); + _DIAGASSERT(s2 != NULL); + while (n && *s1 == *s2 && *s1) { s1++; s2++; diff --git a/lib/libc/string/wcsncpy.c b/lib/libc/string/wcsncpy.c index 7bc77008b1d..c55c92a3b0e 100644 --- a/lib/libc/string/wcsncpy.c +++ b/lib/libc/string/wcsncpy.c @@ -1,4 +1,4 @@ -/* $NetBSD: wcsncpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $ */ +/* $NetBSD: wcsncpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wcsncpy.c,v 1.1 2000/12/23 23:14:36 itojun Exp $"); +__RCSID("$NetBSD: wcsncpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> wchar_t * @@ -44,6 +45,9 @@ wcsncpy(s1, s2, n) wchar_t *p; const wchar_t *q; + _DIAGASSERT(s1 != NULL); + _DIAGASSERT(s2 != NULL); + *s1 = '\0'; p = s1; q = s2; diff --git a/lib/libc/string/wcspbrk.c b/lib/libc/string/wcspbrk.c index 16e3e3d74d8..afcf33e1169 100644 --- a/lib/libc/string/wcspbrk.c +++ b/lib/libc/string/wcspbrk.c @@ -1,4 +1,4 @@ -/* $NetBSD: wcspbrk.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */ +/* $NetBSD: wcspbrk.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wcspbrk.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +__RCSID("$NetBSD: wcspbrk.c,v 1.2 2001/01/03 14:29:37 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> wchar_t * @@ -43,6 +44,9 @@ wcspbrk(s, set) const wchar_t *p; const wchar_t *q; + _DIAGASSERT(s != NULL); + _DIAGASSERT(set != NULL); + p = s; while (*p) { q = set; diff --git a/lib/libc/string/wcsrchr.c b/lib/libc/string/wcsrchr.c index 7465dcf344b..9b8730c7617 100644 --- a/lib/libc/string/wcsrchr.c +++ b/lib/libc/string/wcsrchr.c @@ -1,4 +1,4 @@ -/* $NetBSD: wcsrchr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */ +/* $NetBSD: wcsrchr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wcsrchr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +__RCSID("$NetBSD: wcsrchr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> wchar_t * @@ -42,6 +43,8 @@ wcsrchr(s, c) { const wchar_t *p; + _DIAGASSERT(s != NULL); + p = s; while (*p) p++; diff --git a/lib/libc/string/wcsspn.c b/lib/libc/string/wcsspn.c index 7243ab8abf7..8d15432dab8 100644 --- a/lib/libc/string/wcsspn.c +++ b/lib/libc/string/wcsspn.c @@ -1,4 +1,4 @@ -/* $NetBSD: wcsspn.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */ +/* $NetBSD: wcsspn.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wcsspn.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +__RCSID("$NetBSD: wcsspn.c,v 1.2 2001/01/03 14:29:37 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> size_t @@ -43,6 +44,9 @@ wcsspn(s, set) const wchar_t *p; const wchar_t *q; + _DIAGASSERT(s != NULL); + _DIAGASSERT(set != NULL); + p = s; while (*p) { q = set; diff --git a/lib/libc/string/wcsstr.c b/lib/libc/string/wcsstr.c index 3e0da529bec..3f3a485f623 100644 --- a/lib/libc/string/wcsstr.c +++ b/lib/libc/string/wcsstr.c @@ -1,4 +1,4 @@ -/* $NetBSD: wcsstr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */ +/* $NetBSD: wcsstr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wcsstr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +__RCSID("$NetBSD: wcsstr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> wchar_t * @@ -44,6 +45,9 @@ wcsstr(big, little) const wchar_t *q; const wchar_t *r; + _DIAGASSERT(big != NULL); + _DIAGASSERT(little != NULL); + if (!*little) { /* LINTED interface specification */ return (wchar_t *)big; diff --git a/lib/libc/string/wcswidth.c b/lib/libc/string/wcswidth.c index 5bd87f39d8f..52f89da6405 100644 --- a/lib/libc/string/wcswidth.c +++ b/lib/libc/string/wcswidth.c @@ -1,4 +1,4 @@ -/* $NetBSD: wcswidth.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */ +/* $NetBSD: wcswidth.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wcswidth.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +__RCSID("$NetBSD: wcswidth.c,v 1.2 2001/01/03 14:29:37 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> int @@ -42,6 +43,8 @@ wcswidth(s, n) { int w; + _DIAGASSERT(s != NULL); + w = 0; while (n && *s) { w += wcwidth(*s); diff --git a/lib/libc/string/wmemchr.c b/lib/libc/string/wmemchr.c index b241c00cb6c..9ca1eedb490 100644 --- a/lib/libc/string/wmemchr.c +++ b/lib/libc/string/wmemchr.c @@ -1,4 +1,4 @@ -/* $NetBSD: wmemchr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */ +/* $NetBSD: wmemchr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wmemchr.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +__RCSID("$NetBSD: wmemchr.c,v 1.2 2001/01/03 14:29:37 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> wchar_t * @@ -43,6 +44,8 @@ wmemchr(s, c, n) { size_t i; + _DIAGASSERT(s != NULL); + for (i = 0; i < n; i++) { if (*s == c) { /* LINTED const castaway */ diff --git a/lib/libc/string/wmemcmp.c b/lib/libc/string/wmemcmp.c index 33af87df383..7943312a7ac 100644 --- a/lib/libc/string/wmemcmp.c +++ b/lib/libc/string/wmemcmp.c @@ -1,4 +1,4 @@ -/* $NetBSD: wmemcmp.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */ +/* $NetBSD: wmemcmp.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wmemcmp.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +__RCSID("$NetBSD: wmemcmp.c,v 1.2 2001/01/03 14:29:37 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> int @@ -43,6 +44,9 @@ wmemcmp(s1, s2, n) { size_t i; + _DIAGASSERT(s1 != NULL); + _DIAGASSERT(s2 != NULL); + for (i = 0; i < n; i++) { if (*s1 != *s2) { /* wchar might be unsigned */ diff --git a/lib/libc/string/wmemcpy.c b/lib/libc/string/wmemcpy.c index dacd5761548..07a3f6f2e60 100644 --- a/lib/libc/string/wmemcpy.c +++ b/lib/libc/string/wmemcpy.c @@ -1,4 +1,4 @@ -/* $NetBSD: wmemcpy.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */ +/* $NetBSD: wmemcpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,11 +30,12 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wmemcpy.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +__RCSID("$NetBSD: wmemcpy.c,v 1.2 2001/01/03 14:29:37 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ -#include <wchar.h> +#include <assert.h> #include <string.h> +#include <wchar.h> wchar_t * wmemcpy(d, s, n) @@ -42,5 +43,9 @@ wmemcpy(d, s, n) const wchar_t *s; size_t n; { + + _DIAGASSERT(d != NULL); + _DIAGASSERT(s != NULL); + return (wchar_t *)memcpy(d, s, n * sizeof(wchar_t)); } diff --git a/lib/libc/string/wmemmove.c b/lib/libc/string/wmemmove.c index 3f8e4cec813..d193e69194c 100644 --- a/lib/libc/string/wmemmove.c +++ b/lib/libc/string/wmemmove.c @@ -1,4 +1,4 @@ -/* $NetBSD: wmemmove.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */ +/* $NetBSD: wmemmove.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,11 +30,12 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wmemmove.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +__RCSID("$NetBSD: wmemmove.c,v 1.2 2001/01/03 14:29:37 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ -#include <wchar.h> +#include <assert.h> #include <string.h> +#include <wchar.h> wchar_t * wmemmove(d, s, n) @@ -42,5 +43,9 @@ wmemmove(d, s, n) const wchar_t *s; size_t n; { + + _DIAGASSERT(d != NULL); + _DIAGASSERT(s != NULL); + return (wchar_t *)memmove(d, s, n * sizeof(wchar_t)); } diff --git a/lib/libc/string/wmemset.c b/lib/libc/string/wmemset.c index 4202928c8d1..c35e1d4953a 100644 --- a/lib/libc/string/wmemset.c +++ b/lib/libc/string/wmemset.c @@ -1,4 +1,4 @@ -/* $NetBSD: wmemset.c,v 1.1 2000/12/23 23:14:37 itojun Exp $ */ +/* $NetBSD: wmemset.c,v 1.2 2001/01/03 14:29:37 lukem Exp $ */ /*- * Copyright (c)1999 Citrus Project, @@ -30,9 +30,10 @@ #include <sys/cdefs.h> #if defined(LIBC_SCCS) && !defined(lint) -__RCSID("$NetBSD: wmemset.c,v 1.1 2000/12/23 23:14:37 itojun Exp $"); +__RCSID("$NetBSD: wmemset.c,v 1.2 2001/01/03 14:29:37 lukem Exp $"); #endif /* LIBC_SCCS and not lint */ +#include <assert.h> #include <wchar.h> wchar_t * @@ -44,6 +45,8 @@ wmemset(s, c, n) size_t i; wchar_t *p; + _DIAGASSERT(s != NULL); + p = (wchar_t *)s; for (i = 0; i < n; i++) { *p = c; |
