> Date: Wed, 23 Dec 2015 20:23:41 +0200
> From: Eli Zaretskii <[email protected]>
> Cc: [email protected]
>
> Yes, you are right, I think I should change the logic there. Will
> resubmit.
Btw, can you tell why you needed this logic:
/* We want to read exactly one character. Do this by
restricting size of output buffer. */
utf8_char_ptr = utf8_char;
for (i = 1; i <= 4; i++)
{
utf8_char_free = i;
iconv_ret = iconv (iconv_to_utf8, &inptr, &bytes_left,
&utf8_char_ptr, &utf8_char_free);
/* If we managed to write a character: */
if (utf8_char_ptr > utf8_char) break;
}
Why cannot you restrict the size of input instead?