about summary refs log tree commit diff
path: root/wcsmbs/wcsrchr.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1999-06-30 16:55:43 +0000
committerUlrich Drepper <drepper@redhat.com>1999-06-30 16:55:43 +0000
commit1cda411d51fa3904b8c096677bd2afd08d784786 (patch)
treef98fe10210cd343195ca432f5af46dbf0e145253 /wcsmbs/wcsrchr.c
parentb3fc5f84d13573b9494fb1f0db9b5e80679e5098 (diff)
downloadglibc-1cda411d51fa3904b8c096677bd2afd08d784786.tar.gz
glibc-1cda411d51fa3904b8c096677bd2afd08d784786.tar.xz
glibc-1cda411d51fa3904b8c096677bd2afd08d784786.zip
Update.
1999-06-30  Ulrich Drepper  <drepper@cygnus.com>

	* wcsmbs/wcsrchr.c: Fix handling of L'\0' parameter.
	* wcsmbs/wcschr.c: Likewise.
Diffstat (limited to 'wcsmbs/wcsrchr.c')
-rw-r--r--wcsmbs/wcsrchr.c12
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;
 }