mirror of
https://gitlab.gnome.org/GNOME/libxml2.git
synced 2025-07-29 11:41:22 +03:00
fixed a bug in the ISO-Latin 1 to UTF8 encoder raised by Morus Walter
* encoding.c: fixed a bug in the ISO-Latin 1 to UTF8 encoder raised by Morus Walter Daniel
This commit is contained in:
@ -577,9 +577,13 @@ isolat1ToUTF8(unsigned char* out, int *outlen,
|
||||
processed++;
|
||||
continue;
|
||||
} else {
|
||||
*out++= ((c >> 6) & 0x1F) | 0xC0;
|
||||
if (out >= outend)
|
||||
/*
|
||||
* make sure there is 2 chars left in advance
|
||||
*/
|
||||
if (out + 1 >= outend) {
|
||||
break;
|
||||
}
|
||||
*out++= ((c >> 6) & 0x1F) | 0xC0;
|
||||
*out++= (c & 0x3F) | 0x80;
|
||||
processed++;
|
||||
}
|
||||
|
Reference in New Issue
Block a user