diff options
Diffstat (limited to 'wcsmbs/wcsrchr.c')
-rw-r--r-- | wcsmbs/wcsrchr.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/wcsmbs/wcsrchr.c b/wcsmbs/wcsrchr.c index 9f032c7624..59184c558b 100644 --- a/wcsmbs/wcsrchr.c +++ b/wcsmbs/wcsrchr.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1995, 1996 Free Software Foundation, Inc. +/* Copyright (C) 1995, 1996, 1999 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper, <drepper@gnu.ai.mit.edu> @@ -28,12 +28,10 @@ wcsrchr (wcs, wc) { const wchar_t *retval = NULL; - while (*wcs != L'\0') - { - if (*wcs == wc) - retval = wcs; - ++wcs; - } + do + if (*wcs == wc) + retval = wcs; + while (*wcs++ != L'\0') return (wchar_t *) retval; } |