diff options
author | Daniel Veillard <veillard@src.gnome.org> | 2002-03-21 13:27:59 +0000 |
---|---|---|
committer | Daniel Veillard <veillard@src.gnome.org> | 2002-03-21 13:27:59 +0000 |
commit | db5529150b89269569b636235ef5371ea08358d6 (patch) | |
tree | e6bb1b990070524103fcc1ace9a4b0709ed496e2 /encoding.c | |
parent | 9e537937a69591d89a56c1b251a3cd7b85610106 (diff) | |
download | android_external_libxml2-db5529150b89269569b636235ef5371ea08358d6.tar.gz android_external_libxml2-db5529150b89269569b636235ef5371ea08358d6.tar.bz2 android_external_libxml2-db5529150b89269569b636235ef5371ea08358d6.zip |
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
Diffstat (limited to 'encoding.c')
-rw-r--r-- | encoding.c | 8 |
1 files changed, 6 insertions, 2 deletions
@@ -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++; } |