X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/2826ef0c631b4b1aff5f0bf8ad7ab2af0920e992..bb69632a56a827bed4cfae842bfffa88259ac1aa:/src/html/htmlpars.cpp diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index f89b6f579f..ba8154d00d 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -557,6 +557,9 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) const { unsigned code = 0; + if (entity.empty()) + return 0; // invalid entity reference + if (entity[0] == wxT('#')) { // NB: parsed value is a number, so it's OK to use wx_str(), internal @@ -564,13 +567,13 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) const const wxStringCharType *ent_s = entity.wx_str(); const wxStringCharType *format; - if (ent_s[1] == wxSTRING_TEXT('x') || ent_s[1] == wxSTRING_TEXT('X')) + if (ent_s[1] == wxS('x') || ent_s[1] == wxS('X')) { - format = wxSTRING_TEXT("%x"); + format = wxS("%x"); ent_s++; } else - format = wxSTRING_TEXT("%u"); + format = wxS("%u"); ent_s++; if (wxSscanf(ent_s, format, &code) != 1) @@ -580,7 +583,7 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) const { // store the literals in wx's internal representation (either char* // in UTF-8 or wchar_t*) for best performance: - #define ENTITY(name, code) { wxSTRING_TEXT(name), code } + #define ENTITY(name, code) { wxS(name), code } static wxHtmlEntityInfo substitutions[] = { ENTITY("AElig", 198), @@ -843,9 +846,10 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) const while (substitutions[substitutions_cnt].code != 0) substitutions_cnt++; - wxHtmlEntityInfo *info = NULL; + wxHtmlEntityInfo *info; #ifdef __WXWINCE__ // bsearch crashes under WinCE for some reason + info = NULL; size_t i; for (i = 0; i < substitutions_cnt; i++) {