X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/17a1ebd101f0653e69736416a2a28d0ada423141..7ea1c917764fb2588fe1aadc75c49ba300f8cb2f:/src/html/htmlpars.cpp?ds=inline diff --git a/src/html/htmlpars.cpp b/src/html/htmlpars.cpp index d6b6ab4c32..b1da8c92df 100644 --- a/src/html/htmlpars.cpp +++ b/src/html/htmlpars.cpp @@ -491,7 +491,8 @@ wxString wxHtmlEntitiesParser::Parse(const wxString& input) { if (c - last > 0) output.append(last, c - last); - if (++c == wxT('\0')) break; + if ( *++c == wxT('\0') ) + break; wxString entity; const wxChar *ent_s = c; @@ -833,11 +834,24 @@ wxChar wxHtmlEntitiesParser::GetEntityChar(const wxString& entity) while (substitutions[substitutions_cnt].code != 0) substitutions_cnt++; - wxHtmlEntityInfo *info; + wxHtmlEntityInfo *info = NULL; +#ifdef __WXWINCE__ + // bsearch crashes under WinCE for some reason + size_t i; + for (i = 0; i < substitutions_cnt; i++) + { + if (entity == substitutions[i].name) + { + info = & substitutions[i]; + break; + } + } +#else info = (wxHtmlEntityInfo*) bsearch(entity.c_str(), substitutions, substitutions_cnt, sizeof(wxHtmlEntityInfo), wxHtmlEntityCompare); +#endif if (info) code = info->code; }