summary |
shortlog |
log |
commit | commitdiff |
tree
raw |
patch |
inline | side by side (from parent 1:
4b7c82a)
EINVAL indicates an invalid multibyte sequence at the end of buffer. It
seems to me that there is no point in swallowing up a single byte and going
on at that point; instead, one might as well just declare the conversion
done after adding the fallback character. This is what this commit does.
&op, &outbytes) == -1)
switch (errno)
{
&op, &outbytes) == -1)
switch (errno)
{
+ *op++ = fallbackchar;
+ *op++ = '\0';
+ return true;
+ case EILSEQ:
+ if (outbytes == 0)
+ return false;
*op++ = fallbackchar;
outbytes--;
ip++;
*op++ = fallbackchar;
outbytes--;
ip++;