From 1cda411d51fa3904b8c096677bd2afd08d784786 Mon Sep 17 00:00:00 2001 From: Ulrich Drepper Date: Wed, 30 Jun 1999 16:55:43 +0000 Subject: Update. 1999-06-30 Ulrich Drepper * wcsmbs/wcsrchr.c: Fix handling of L'\0' parameter. * wcsmbs/wcschr.c: Likewise. --- wcsmbs/wcsrchr.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'wcsmbs/wcsrchr.c') 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, @@ -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; } -- cgit v1.1