eina simple xml parser - remove pointless memcmp of 0 bytes
authorCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sat, 29 Jul 2017 02:03:01 +0000 (11:03 +0900)
committerCarsten Haitzler (Rasterman) <raster@rasterman.com>
Sat, 29 Jul 2017 02:03:01 +0000 (11:03 +0900)
no point - all we are doing is having a final fallback of any tag that
starts with ! that isnt a special one like !DOCTYPE, !-- comment and
![CDATA stuff... analysers dont like these pointless calls.

found by PVS studio

src/lib/eina/eina_simple_xml_parser.c

index ad0ce62..93e1416 100644 (file)
@@ -351,9 +351,7 @@ eina_simple_xml_parse(const char *buf, unsigned buflen, Eina_Bool strip, Eina_Si
                             type = EINA_SIMPLE_XML_CDATA;
                             toff = sizeof("![CDATA[") - 1;
                          }
-                       else if ((itr + sizeof("<!>") - 1 < itr_end) &&
-                                (!memcmp(itr + 2, "",
-                                         sizeof("") - 1)))
+                       else if (itr + sizeof("<!>") - 1 < itr_end)
                          {
                             type = EINA_SIMPLE_XML_DOCTYPE_CHILD;
                             toff = sizeof("!") - 1;