properly NUL-terminate the output in wxMBConvUTF16swap::WC2MB()

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@38575 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Vadim Zeitlin
2006-04-05 15:18:05 +00:00
parent d31a29b566
commit 64f56529a8

View File

@@ -991,8 +991,11 @@ size_t wxMBConvUTF16swap::WC2MB(char *buf, const wchar_t *psz, size_t n) const
psz++; psz++;
} }
if ( buf && len < n ) if ( buf && len < n - 1 )
*buf = '\0'; {
buf[0] =
buf[1] = '\0';
}
return len; return len;
} }