From 6b3bb52b8465d5ead8eaa77a8829fdb1341cbbce Mon Sep 17 00:00:00 2001 From: Jeff Johnston Date: Mon, 17 Mar 2003 17:12:32 +0000 Subject: [PATCH] 2003-03-17 Bob Cassels * libc/string/wcschr.c: (wcschr): Look for character first, then for end of string, so you can do wcschr(x, '\0'). --- newlib/ChangeLog | 5 +++++ 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 + + * 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 * 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; }