iconv() really never set the trailing 0.
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@16578 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -723,6 +723,10 @@ size_t IC_CharSet::WC2MB(char *buf, const wchar_t *psz, size_t n)
|
|||||||
cres = iconv( w2m, ICONV_CHAR_CAST(&psz), &inbuf, &buf, &outbuf );
|
cres = iconv( w2m, ICONV_CHAR_CAST(&psz), &inbuf, &buf, &outbuf );
|
||||||
|
|
||||||
res = n-outbuf;
|
res = n-outbuf;
|
||||||
|
|
||||||
|
// iconv() doesn't set the trailing zero, but moves buf to
|
||||||
|
// that position
|
||||||
|
buf[0] = 0;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user