From: Ulrich Drepper Date: Wed, 19 Jan 2000 06:06:35 +0000 (+0000) Subject: Don't set errno if byte sequence is only incomplete but correct. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=0078839cea55d7100074766e299c69234b3ce182;p=thirdparty%2Fglibc.git Don't set errno if byte sequence is only incomplete but correct. --- diff --git a/wcsmbs/mbrtowc.c b/wcsmbs/mbrtowc.c index 78ff2a22dd3..288c7d2f2c8 100644 --- a/wcsmbs/mbrtowc.c +++ b/wcsmbs/mbrtowc.c @@ -1,4 +1,4 @@ -/* Copyright (C) 1996, 1997, 1998, 1999 Free Software Foundation, Inc. +/* Copyright (C) 1996, 1997, 1998, 1999, 2000 Free Software Foundation, Inc. This file is part of the GNU C Library. Contributed by Ulrich Drepper , 1996. @@ -90,9 +90,11 @@ __mbrtowc (wchar_t *pwc, const char *s, size_t n, mbstate_t *ps) else result = inbuf - (const unsigned char *) s; } + else if (status == __GCONV_INCOMPLETE_INPUT) + result = (size_t) -2; else { - result = status == GCONV_INCOMPLETE_INPUT ? (size_t) -2 : (size_t) -1; + result = (size_t) -1; __set_errno (EILSEQ); }