From: Rhodri James Date: Fri, 4 Aug 2017 16:41:37 +0000 (+0100) Subject: Fix wide character comparisons in external_entity_optioner() X-Git-Tag: R_2_2_5~24^2~128 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=3bda331fff0b868d6a49b746e5e7bfb10a705a3f;p=libexpat Fix wide character comparisons in external_entity_optioner() --- diff --git a/expat/tests/runtests.c b/expat/tests/runtests.c index cbf9437d..698a024f 100644 --- a/expat/tests/runtests.c +++ b/expat/tests/runtests.c @@ -72,12 +72,15 @@ #ifdef XML_UNICODE_WCHAR_T #define XML_FMT_CHAR "lc" #define XML_FMT_STR "ls" +#include +#define xcstrcmp(s, t) wcscmp((s), (t)) #else #ifdef XML_UNICODE #error "No support for UTF-16 character without wchar_t in tests" #else #define XML_FMT_CHAR "c" #define XML_FMT_STR "s" +#define xcstrcmp(s, t) strcmp((s), (t)) #endif /* XML_UNICODE */ #endif /* XML_UNICODE_WCHAR_T */ @@ -370,7 +373,7 @@ dummy_skip_handler(void *UNUSED_P(userData), /* Useful external entity handler */ typedef struct ExtOption { - const char *system_id; + const XML_Char *system_id; const char *parse_text; } ExtOption; @@ -385,7 +388,7 @@ external_entity_optioner(XML_Parser parser, XML_Parser ext_parser; while (options->parse_text != NULL) { - if (!strcmp(systemId, options->system_id)) { + if (!xcstrcmp(systemId, options->system_id)) { enum XML_Status rc; ext_parser = XML_ExternalEntityParserCreate(parser, context, NULL);