fix for conversion buffer size problems
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@17628 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -251,7 +251,8 @@ wxString::wxString(const char *psz, wxMBConv& conv, size_t nLength)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( conv.MB2WC(m_pchData, psz, nLen) != (size_t)-1 )
|
// MB2WC wants the buffer size, not the string length
|
||||||
|
if ( conv.MB2WC(m_pchData, psz, nLen + 1) != (size_t)-1 )
|
||||||
{
|
{
|
||||||
// initialized ok
|
// initialized ok
|
||||||
return;
|
return;
|
||||||
@@ -290,7 +291,8 @@ wxString::wxString(const wchar_t *pwz, wxMBConv& conv, size_t nLength)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
if ( conv.WC2MB(m_pchData, pwz, nLen) != (size_t)-1 )
|
// WC2MB wants the buffer size, not the string length
|
||||||
|
if ( conv.WC2MB(m_pchData, pwz, nLen + 1) != (size_t)-1 )
|
||||||
{
|
{
|
||||||
// initialized ok
|
// initialized ok
|
||||||
return;
|
return;
|
||||||
|
Reference in New Issue
Block a user