Browse Source

unbreak wcschr(string, L'\0') which was incorrectly returning NULL

rather than a pointer to the terminating nul; ok deraadt@
OPENBSD_4_5
djm 16 years ago
parent
commit
11ee72166d
1 changed files with 5 additions and 3 deletions
  1. +5
    -3
      src/lib/libc/string/wcschr.c

+ 5
- 3
src/lib/libc/string/wcschr.c View File

@ -1,4 +1,4 @@
/* $OpenBSD: wcschr.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */
/* $OpenBSD: wcschr.c,v 1.4 2008/08/23 05:34:36 djm Exp $ */
/* $NetBSD: wcschr.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ /* $NetBSD: wcschr.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
/*- /*-
@ -37,12 +37,14 @@ wcschr(const wchar_t *s, wchar_t c)
const wchar_t *p; const wchar_t *p;
p = s; p = s;
while (*p) {
for (;;) {
if (*p == c) { if (*p == c) {
/* LINTED interface specification */ /* LINTED interface specification */
return (wchar_t *)p; return (wchar_t *)p;
} }
if (!*p)
return NULL;
p++; p++;
} }
return NULL;
/* NOTREACHED */
} }

Loading…
Cancel
Save