corrected bug in wxMBConvStrictUTF8::FromWChar(): it wrote one extra NUL when used with explicit source length
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53891 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -987,7 +987,7 @@ wxMBConvStrictUTF8::FromWChar(char *dst, size_t dstLen,
|
|||||||
|
|
||||||
for ( const wchar_t *wp = src; ; wp++ )
|
for ( const wchar_t *wp = src; ; wp++ )
|
||||||
{
|
{
|
||||||
if ( !(srcLen == wxNO_LEN ? *wp : srcLen--) )
|
if ( !(srcLen == wxNO_LEN ? *wp : srcLen) )
|
||||||
{
|
{
|
||||||
// all done successfully, just add the trailing NULL if we are not
|
// all done successfully, just add the trailing NULL if we are not
|
||||||
// using explicit length
|
// using explicit length
|
||||||
@@ -1007,6 +1007,8 @@ wxMBConvStrictUTF8::FromWChar(char *dst, size_t dstLen,
|
|||||||
return written;
|
return written;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if ( srcLen != wxNO_LEN )
|
||||||
|
srcLen--;
|
||||||
|
|
||||||
wxUint32 code;
|
wxUint32 code;
|
||||||
#ifdef WC_UTF16
|
#ifdef WC_UTF16
|
||||||
|
Reference in New Issue
Block a user