diff options
author | Ulrich Drepper <drepper@redhat.com> | 2000-01-19 06:06:35 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 2000-01-19 06:06:35 +0000 |
commit | 0078839cea55d7100074766e299c69234b3ce182 (patch) | |
tree | 23a5d7db4a6bd2bc779f15be7edaf0eebfd1d3a9 /wcsmbs | |
parent | aa4b3e5228baa070d1681cdae3278e4c2486c217 (diff) | |
download | glibc-0078839cea55d7100074766e299c69234b3ce182.zip glibc-0078839cea55d7100074766e299c69234b3ce182.tar.gz glibc-0078839cea55d7100074766e299c69234b3ce182.tar.bz2 |
Don't set errno if byte sequence is only incomplete but correct.
Diffstat (limited to 'wcsmbs')
-rw-r--r-- | wcsmbs/mbrtowc.c | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/wcsmbs/mbrtowc.c b/wcsmbs/mbrtowc.c index 78ff2a2..288c7d2 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 <drepper@gnu.org>, 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); } |