fix iconv conversion to UTF-32 with implicit (big) endianness

maintainer's notes:

commit 95c6044e2a split UTF-32 and
UTF-32BE but neglected to add a case for the former as a destination
encoding, resulting in it wrongly being handled by the default case.
the intent was that the value of the macro be chosen to encode "big
endian" in the low bits, so that no code would be needed, but this was
botched; instead, handle it the way UCS2 is handled.
This commit is contained in:
Will Dietz 2018-05-03 13:44:53 -05:00 committed by Rich Felker
parent 55a661ff5e
commit 99f4237a69
1 changed files with 2 additions and 0 deletions

View File

@ -646,6 +646,8 @@ size_t iconv(iconv_t cd, char **restrict in, size_t *restrict inb, char **restri
*out += 4;
*outb -= 4;
break;
case UTF_32:
totype = UTF_32BE;
case UTF_32BE:
case UTF_32LE:
if (*outb < 4) goto toobig;