diff options
author | Ulrich Drepper <drepper@redhat.com> | 1999-06-30 16:55:43 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1999-06-30 16:55:43 +0000 |
commit | 1cda411d51fa3904b8c096677bd2afd08d784786 (patch) | |
tree | f98fe10210cd343195ca432f5af46dbf0e145253 | |
parent | b3fc5f84d13573b9494fb1f0db9b5e80679e5098 (diff) | |
download | glibc-1cda411d51fa3904b8c096677bd2afd08d784786.zip glibc-1cda411d51fa3904b8c096677bd2afd08d784786.tar.gz glibc-1cda411d51fa3904b8c096677bd2afd08d784786.tar.bz2 |
Update.
1999-06-30 Ulrich Drepper <drepper@cygnus.com>
* wcsmbs/wcsrchr.c: Fix handling of L'\0' parameter.
* wcsmbs/wcschr.c: Likewise.
-rw-r--r-- | ChangeLog | 5 | ||||
-rw-r--r-- | wcsmbs/wcschr.c | 7 | ||||
-rw-r--r-- | wcsmbs/wcsrchr.c | 12 |
3 files changed, 13 insertions, 11 deletions
@@ -1,3 +1,8 @@ +1999-06-30 Ulrich Drepper <drepper@cygnus.com> + + * wcsmbs/wcsrchr.c: Fix handling of L'\0' parameter. + * wcsmbs/wcschr.c: Likewise. + 1999-06-28 Ulrich Drepper <drepper@cygnus.com> * sysdeps/libm-ieee754/e_gamma_r.c: Initialize *signgamp for NaN diff --git a/wcsmbs/wcschr.c b/wcsmbs/wcschr.c index 7f5c7dc..a884c0b 100644 --- a/wcsmbs/wcschr.c +++ b/wcsmbs/wcschr.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. The GNU C Library is free software; you can redistribute it and/or @@ -25,11 +25,10 @@ wcschr (wcs, wc) register const wchar_t *wcs; register const wchar_t wc; { - while (*wcs != L'\0') + do if (*wcs == wc) return (wchar_t *) wcs; - else - ++wcs; + while (*wcs++ != L'\0') return NULL; } diff --git a/wcsmbs/wcsrchr.c b/wcsmbs/wcsrchr.c index 9f032c7..59184c5 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; } |