summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libc/string/wcschr.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/src/lib/libc/string/wcschr.c b/src/lib/libc/string/wcschr.c
index c06127e087..b84a2d32e3 100644
--- a/src/lib/libc/string/wcschr.c
+++ b/src/lib/libc/string/wcschr.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: wcschr.c,v 1.3 2005/08/08 08:05:37 espie Exp $ */ 1/* $OpenBSD: wcschr.c,v 1.4 2008/08/23 05:34:36 djm Exp $ */
2/* $NetBSD: wcschr.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */ 2/* $NetBSD: wcschr.c,v 1.2 2001/01/03 14:29:36 lukem Exp $ */
3 3
4/*- 4/*-
@@ -37,12 +37,14 @@ wcschr(const wchar_t *s, wchar_t c)
37 const wchar_t *p; 37 const wchar_t *p;
38 38
39 p = s; 39 p = s;
40 while (*p) { 40 for (;;) {
41 if (*p == c) { 41 if (*p == c) {
42 /* LINTED interface specification */ 42 /* LINTED interface specification */
43 return (wchar_t *)p; 43 return (wchar_t *)p;
44 } 44 }
45 if (!*p)
46 return NULL;
45 p++; 47 p++;
46 } 48 }
47 return NULL; 49 /* NOTREACHED */
48} 50}