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 | |
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').
-rw-r--r-- | newlib/ChangeLog | 5 | ||||
-rw-r--r-- | newlib/libc/string/wcschr.c | 5 |
2 files changed, 7 insertions, 3 deletions
diff --git a/newlib/ChangeLog b/newlib/ChangeLog index 53f13844e..f21984b75 100644 --- a/newlib/ChangeLog +++ b/newlib/ChangeLog @@ -1,3 +1,8 @@ +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'). + 2003-03-10 Corinna Vinschen <corinna@vinschen.de> * libc/include/stdio.h: Declare fgetpos, fsetpos, fseeko and ftello 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; } |