]> granicus.if.org Git - libexpat/commitdiff
Fix wide character issues in param_entity_match_handler()
authorRhodri James <rhodri@kynesim.co.uk>
Fri, 4 Aug 2017 16:50:50 +0000 (17:50 +0100)
committerSebastian Pipping <sebastian@pipping.org>
Tue, 29 Aug 2017 20:30:32 +0000 (22:30 +0200)
expat/tests/runtests.c

index b724db173a3303a0a5fdfc0ec9fb21a6cbf4abc9..18d42406b9d6632740c50dc5c8b77353e75e5f61 100644 (file)
@@ -436,13 +436,13 @@ param_entity_match_handler(void           *UNUSED_P(userData),
         entity_value_to_match == NULL) {
         return;
     }
-    if (!strcmp(entityName, entity_name_to_match)) {
+    if (!xcstrcmp(entityName, entity_name_to_match)) {
         /* The cast here is safe because we control the horizontal and
          * the vertical, and we therefore know our strings are never
          * going to overflow an int.
          */
-        if (value_length != (int)strlen(entity_value_to_match) ||
-            strncmp(value, entity_value_to_match, value_length)) {
+        if (value_length != (int)xcstrlen(entity_value_to_match) ||
+            xcstrncmp(value, entity_value_to_match, value_length)) {
             entity_match_flag = ENTITY_MATCH_FAIL;
         } else {
             entity_match_flag = ENTITY_MATCH_SUCCESS;