euc encoding: Emit EILSEQ on illegal euc conversions
authorJohn Marino <draco@marino.st>
Mon, 2 Nov 2015 23:04:24 +0000 (00:04 +0100)
committerJohn Marino <draco@marino.st>
Mon, 2 Nov 2015 23:04:24 +0000 (00:04 +0100)
Omission caught by NetBSD testsuite, run by bapt@FreeBSD.org

lib/libc/locale/euc.c

index bd7c050..ad623d7 100644 (file)
@@ -373,6 +373,7 @@ _EUC_mbrtowc_impl(wchar_t * __restrict pwc, const char * __restrict s,
                /* Incomplete multibyte sequence */
                es->want = want - i;
                es->ch = wc;
+               errno = EILSEQ;
                return ((size_t)-2);
        }
        if (pwc != NULL)