X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/422e411e954e0232d9765665a7640f095ca3c9d5..588c80dea16b3ab32c7f1f8f15b62eb4450a20a9:/src/common/strconv.cpp?ds=sidebyside diff --git a/src/common/strconv.cpp b/src/common/strconv.cpp index 74e3a3be0b..986bf4f82d 100644 --- a/src/common/strconv.cpp +++ b/src/common/strconv.cpp @@ -20,10 +20,6 @@ // headers // ---------------------------------------------------------------------------- -#if defined(__GNUG__) && !defined(NO_GCC_PRAGMA) - #pragma implementation "strconv.h" -#endif - // For compilers that support precompilation, includes "wx.h". #include "wx/wxprec.h" @@ -1425,7 +1421,7 @@ wxMBConv_iconv::wxMBConv_iconv(const wxChar *name) wxLogTrace(TRACE_STRCONV, wxT("iconv wchar_t charset is \"%s\"%s"), - ms_wcCharsetName.empty() ? "" + ms_wcCharsetName.empty() ? _T("") : ms_wcCharsetName.c_str(), ms_wcNeedsSwap ? _T(" (needs swap)") : _T("")); @@ -1534,7 +1530,8 @@ size_t wxMBConv_iconv::WC2MB(char *buf, const wchar_t *psz, size_t n) const wxMutexLocker lock(wxConstCast(this, wxMBConv_iconv)->m_iconvMutex); #endif - size_t inbuf = wxWcslen(psz) * SIZEOF_WCHAR_T; + size_t inlen = wxWcslen(psz); + size_t inbuf = inlen * SIZEOF_WCHAR_T; size_t outbuf = n; size_t res, cres; @@ -1546,9 +1543,9 @@ size_t wxMBConv_iconv::WC2MB(char *buf, const wchar_t *psz, size_t n) const // (doing WC_BSWAP twice on the original buffer won't help, as it // could be in read-only memory, or be accessed in some other thread) tmpbuf = (wchar_t *)malloc(inbuf + SIZEOF_WCHAR_T); - for ( size_t n = 0; n < inbuf; n++ ) + for ( size_t n = 0; n < inlen; n++ ) tmpbuf[n] = WC_BSWAP(psz[n]); - tmpbuf[inbuf] = L'\0'; + tmpbuf[inlen] = L'\0'; psz = tmpbuf; }