X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/0e2710a6b96921920560271253c8409da47b8129..c2740a5aab5ab5ea5305f272465e137f9ad02c3c:/src/xml/xml.cpp diff --git a/src/xml/xml.cpp b/src/xml/xml.cpp index fc447594a5..f55ad6f7a1 100644 --- a/src/xml/xml.cpp +++ b/src/xml/xml.cpp @@ -370,7 +370,7 @@ inline static wxString CharToString(wxMBConv *conv, return str; } else - return wxString(s, len); + return wxString(s, len != wxSTRING_MAXLEN ? len : strlen(s)); #endif } @@ -482,7 +482,8 @@ static int UnknownEncodingHnd(void * WXUNUSED(encodingHandlerData), // We must build conversion table for expat. The easiest way to do so // is to let wxCSConv convert as string containing all characters to // wide character representation: - wxCSConv conv(wxString(name, wxConvLibc)); + wxString str(name, wxConvLibc); + wxCSConv conv(str); char mbBuf[2]; wchar_t wcBuf[10]; size_t i; @@ -499,7 +500,7 @@ static int UnknownEncodingHnd(void * WXUNUSED(encodingHandlerData), } info->map[i+1] = (int)wcBuf[0]; } - + info->data = NULL; info->convert = NULL; info->release = NULL;