don't write extraneous NUL bytes in wxMBConv_iconv::FromWChar()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@53872 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2008-05-31 01:55:45 +00:00
parent 2588ee861f
commit e5c28d8710

View File

@@ -2194,12 +2194,6 @@ size_t wxMBConv_iconv::FromWChar(char *dst, size_t dstLen,
cres = iconv(w2m, ICONV_CHAR_CAST(&inbuf), &inbuflen, &dst, &outbuflen); cres = iconv(w2m, ICONV_CHAR_CAST(&inbuf), &inbuflen, &dst, &outbuflen);
res = dstLen - outbuflen; res = dstLen - outbuflen;
// NB: iconv was given only wcslen(src) characters on input, and so
// it couldn't convert the trailing zero. Let's do it ourselves
// if there's some room left for it in the output buffer.
if (res < dstLen)
dst[0] = 0;
} }
else // no destination buffer else // no destination buffer
{ {