projects
/
libexpat
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
c70ed03
)
Fix bug with UTF16 to UTF8 conversion for chars 0x80..0xFF
author
James Clark
<jjc@jclark.com>
Mon, 2 Feb 1998 11:14:46 +0000
(11:14 +0000)
committer
James Clark
<jjc@jclark.com>
Mon, 2 Feb 1998 11:14:46 +0000
(11:14 +0000)
expat/xmltok/xmltok.c
patch
|
blob
|
history
diff --git
a/expat/xmltok/xmltok.c
b/expat/xmltok/xmltok.c
index cbca6b18c31b3991514dd4636bb2571599a72020..7bcfb0c7dc400113eaab528cedcc18aff60a0a5b 100755
(executable)
--- a/
expat/xmltok/xmltok.c
+++ b/
expat/xmltok/xmltok.c
@@
-256,12
+256,15
@@
void PREFIX(toUtf8)(const ENCODING *enc, \
unsigned char hi = GET_HI(from); \
switch (hi) { \
case 0: \
- if (*toP == toLim) { \
- *fromP = from; \
- return; \
+ if (lo < 0x80) { \
+ if (*toP == toLim) { \
+ *fromP = from; \
+ return; \
+ } \
+ *(*toP)++ = lo; \
+ break; \
} \
- *(*toP)++ = lo; \
- break; \
+ /* fall through */ \
case 0x1: case 0x2: case 0x3: \
case 0x4: case 0x5: case 0x6: case 0x7: \
if (toLim - *toP < 2) { \