summaryrefslogtreecommitdiffstats
path: root/Utilities/cmexpat/lib/xmltok.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2017-08-07 14:10:14 (GMT)
committerBrad King <brad.king@kitware.com>2017-08-07 14:19:30 (GMT)
commit44e5fb9c7ea3e3b0288cc24ec85554112e966d73 (patch)
tree32f6032ff5567c0f1cda418817d3b113df265af5 /Utilities/cmexpat/lib/xmltok.c
parent6276ec3726ce4bb92748b0a70b1102e38924b626 (diff)
parent7e08602c761cabe75c557eacf738b716a4a1e18a (diff)
downloadCMake-44e5fb9c7ea3e3b0288cc24ec85554112e966d73.zip
CMake-44e5fb9c7ea3e3b0288cc24ec85554112e966d73.tar.gz
CMake-44e5fb9c7ea3e3b0288cc24ec85554112e966d73.tar.bz2
Merge branch 'upstream-expat' into update-expat
* upstream-expat: expat 2017-08-02 (97c6bd01)
Diffstat (limited to 'Utilities/cmexpat/lib/xmltok.c')
-rw-r--r--Utilities/cmexpat/lib/xmltok.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/Utilities/cmexpat/lib/xmltok.c b/Utilities/cmexpat/lib/xmltok.c
index cdf0720..db4a5c8 100644
--- a/Utilities/cmexpat/lib/xmltok.c
+++ b/Utilities/cmexpat/lib/xmltok.c
@@ -1019,7 +1019,11 @@ streqci(const char *s1, const char *s2)
if (ASCII_a <= c1 && c1 <= ASCII_z)
c1 += ASCII_A - ASCII_a;
if (ASCII_a <= c2 && c2 <= ASCII_z)
- c2 += ASCII_A - ASCII_a;
+ /* The following line will never get executed. streqci() is
+ * only called from two places, both of which guarantee to put
+ * upper-case strings into s2.
+ */
+ c2 += ASCII_A - ASCII_a; /* LCOV_EXCL_LINE */
if (c1 != c2)
return 0;
if (!c1)
@@ -1291,7 +1295,7 @@ XmlUtf8Encode(int c, char *buf)
};
if (c < 0)
- return 0;
+ return 0; /* LCOV_EXCL_LINE: this case is always eliminated beforehand */
if (c < min2) {
buf[0] = (char)(c | UTF8_cval1);
return 1;
@@ -1314,7 +1318,7 @@ XmlUtf8Encode(int c, char *buf)
buf[3] = (char)((c & 0x3f) | 0x80);
return 4;
}
- return 0;
+ return 0; /* LCOV_EXCL_LINE: this case too is eliminated before calling */
}
int FASTCALL
@@ -1465,6 +1469,9 @@ XmlInitUnknownEncoding(void *mem,
else if (c < 0) {
if (c < -4)
return 0;
+ /* Multi-byte sequences need a converter function */
+ if (!convert)
+ return 0;
e->normal.type[i] = (unsigned char)(BT_LEAD2 - (c + 2));
e->utf8[i][0] = 0;
e->utf16[i] = 0;