]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Don't set errno if byte sequence is only incomplete but correct.
authorUlrich Drepper <drepper@redhat.com>
Wed, 19 Jan 2000 06:06:35 +0000 (06:06 +0000)
committerUlrich Drepper <drepper@redhat.com>
Wed, 19 Jan 2000 06:06:35 +0000 (06:06 +0000)
wcsmbs/mbrtowc.c

index 78ff2a22dd3869bf996cbd1c9fe413fc14e873f5..288c7d2f2c890d5e92d86734831af0737a11ac9f 100644 (file)
@@ -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);
     }