diff options
author | Jeff Johnston <jjohnstn@redhat.com> | 2003-03-17 17:12:32 +0000 |
---|---|---|
committer | Jeff Johnston <jjohnstn@redhat.com> | 2003-03-17 17:12:32 +0000 |
commit | 6b3bb52b8465d5ead8eaa77a8829fdb1341cbbce (patch) | |
tree | c11d0e669b59f896ed761e805aa5370367c73e48 /newlib/libc/string/wcschr.c | |
parent | c745f853be44395ff7a11f944c8ef435bdd234f8 (diff) | |
download | cygnal-6b3bb52b8465d5ead8eaa77a8829fdb1341cbbce.tar.gz cygnal-6b3bb52b8465d5ead8eaa77a8829fdb1341cbbce.tar.bz2 cygnal-6b3bb52b8465d5ead8eaa77a8829fdb1341cbbce.zip |
2003-03-17 Bob Cassels <bcassels@abinitio.com>
* libc/string/wcschr.c: (wcschr): Look for character first,
then for end of string, so you can do wcschr(x, '\0').
Diffstat (limited to 'newlib/libc/string/wcschr.c')
-rw-r--r-- | newlib/libc/string/wcschr.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/newlib/libc/string/wcschr.c b/newlib/libc/string/wcschr.c index fa213c90b..acc07a521 100644 --- a/newlib/libc/string/wcschr.c +++ b/newlib/libc/string/wcschr.c @@ -69,14 +69,13 @@ _DEFUN (wcschr, (s, c), _CONST wchar_t *p; p = s; - while (*p) + do { if (*p == c) { /* LINTED interface specification */ return (wchar_t *) p; } - p++; - } + } while (*p++); return NULL; } |