From: Václav Slavík Date: Tue, 16 Nov 2004 11:58:56 +0000 (+0000) Subject: fixed wxEncodingConverter-base wxCSConv to report failures as expected X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/c643a97740f7c806b3886dab3e37a0d54c1b3ba3 fixed wxEncodingConverter-base wxCSConv to report failures as expected git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@30563 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 70493dbc12..ca7031528b 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -2216,7 +2216,10 @@ public: { size_t inbuf = strlen(psz); if (buf) - m2w.Convert(psz,buf); + { + if (!m2w.Convert(psz,buf)) + return (size_t)-1; + } return inbuf; } @@ -2224,7 +2227,10 @@ public: { const size_t inbuf = wxWcslen(psz); if (buf) - w2m.Convert(psz,buf); + { + if (!w2m.Convert(psz,buf)) + return (size_t)-1; + } return inbuf; }