]> granicus.if.org Git - libexpat/commitdiff
Fix for bug #600479: error decoding UTF-8 triplet
authorKarl Waclawek <kwaclaw@users.sourceforge.net>
Tue, 27 Aug 2002 00:28:48 +0000 (00:28 +0000)
committerKarl Waclawek <kwaclaw@users.sourceforge.net>
Tue, 27 Aug 2002 00:28:48 +0000 (00:28 +0000)
expat/lib/xmltok.c

index 7fc00e899d91830131855a90e1c88c4dc1cebac4..0e9a18a2ba37b69555160b15a873d60966ff0205 100644 (file)
 #define UTF8_INVALID3(p) \
   (((p)[2] & 0x80) == 0 \
   || \
-  ((*p) == 0xEF ? (p)[2] > 0xBD : ((p)[2] & 0xC0) == 0xC0) \
+  ((*p) == 0xEF && (p)[1] == 0xBF \
+    ? \
+    (p)[2] > 0xBD \
+    : \
+    ((p)[2] & 0xC0) == 0xC0) \
   || \
   ((*p) == 0xE0 \
     ? \