summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--newlib/ChangeLog5
-rw-r--r--newlib/libc/string/wcschr.c5
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;
}