mirror of
https://github.com/freebsd/freebsd-src.git
synced 2026-11-07 04:36:52 -10:00
libc/locale: Check EILSEQ return
_citrus_iconv_std_iconv_convert can return EILSEQ without setting
invlen. As a result, we should check EILSEQ in the return value or it
will incorrectly return -2
Reviewed by: kevans
Fixes: e2030ca246 ("libc: fix c*rtomb/mbrtoc*")
MFC after: 2 days
Differential Revision: https://reviews.freebsd.org/D61151
This commit is contained in:
1 parent
e89d0e74e2
commit
b138d017c7
1 file changed
+1
-1
@@ -123,7 +123,7 @@ mbrtocXX_l(charXX_t * __restrict pc, const char * __restrict s, size_t n,
|
||||
continue;
|
||||
|
||||
/* Illegal sequence. */
|
||||
if (invlen > 0) {
|
||||
if (invlen > 0 || err == EILSEQ) {
|
||||
cs->srcbuf_len = 0;
|
||||
errno = EILSEQ;
|
||||
return ((size_t)-1);
|
||||
|
||||
Reference in new issue
Block a user