]> granicus.if.org Git - libexpat/commitdiff
Comment change: exclude unreachable line from coverage figures
authorRhodri James <rhodri@kynesim.co.uk>
Mon, 19 Jun 2017 14:09:22 +0000 (15:09 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Sat, 22 Jul 2017 20:49:20 +0000 (22:49 +0200)
expat/lib/xmltok_impl.c

index 16547237e08f07b326054b76da95fcd9d3f33010..4fa1ff679ce59c038caa9c8c85fe496da797d71a 100644 (file)
@@ -1704,8 +1704,14 @@ PREFIX(nameMatchesAscii)(const ENCODING *UNUSED_P(enc), const char *ptr1,
                          const char *end1, const char *ptr2)
 {
   for (; *ptr2; ptr1 += MINBPC(enc), ptr2++) {
-    if (end1 - ptr1 < MINBPC(enc))
-      return 0;
+    if (end1 - ptr1 < MINBPC(enc)) {
+      /* This line cannot be executed.  THe incoming data has already
+       * been tokenized once, so imcomplete characters like this have
+       * already been eliminated from the input.  Retaining the
+       * paranoia check is still valuable, however.
+       */
+      return 0; /* LCOV_EXCL_LINE */
+    }
     if (!CHAR_MATCHES(enc, ptr1, *ptr2))
       return 0;
   }