fixed iso-8859-1 handling to report failures

git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/branches/WX_2_4_BRANCH@24284 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
Václav Slavík
2003-10-24 19:25:48 +00:00
parent 06e92fcce1
commit 330ab29f70

View File

@@ -1071,7 +1071,19 @@ size_t wxCSConv::WC2MB(char *buf, const wchar_t *psz, size_t n) const
if (buf)
{
for (size_t c = 0; c <= len; c++)
buf[c] = (psz[c] > 0xff) ? '?' : psz[c];
{
if (psz[c] > 0xFF)
return (size_t)-1;
buf[c] = psz[c];
}
}
else
{
for (size_t c = 0; c <= len; c++)
{
if (psz[c] > 0xFF)
return (size_t)-1;
}
}
return len;