X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/a6ed2b09a3e737e58f9ee7d0674be6c7ae1427c5..bc8e3eadaf1d794cb05e4f88bc8dc206d4d43bc4:/src/common/string.cpp diff --git a/src/common/string.cpp b/src/common/string.cpp index 1a86ca3d1b..764e1ff3b8 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -43,6 +43,10 @@ #include #include +#ifndef __WXMSW__ +#include +#endif + #ifdef __SALFORDC__ #include #endif @@ -319,7 +323,7 @@ bool wxStringBase::AllocBeforeWrite(size_t nLen) // it doesn't really matter what the string length is as it's going to be // overwritten later but, for extra safety, set it to 0 for now as we may // have some junk in m_pchData - pData->nDataLength = 0; + GetStringData()->nDataLength = 0; return true; } @@ -1835,7 +1839,14 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr) // vsnprintf() may return either -1 (traditional Unix behaviour) or the // total number of characters which would have been written if the // buffer were large enough - if ( len >= 0 && len <= size ) + // also, it may return an errno may be something like EILSEQ, + // in which case we need to break out + if ( (len >= 0 && len <= size) + // No EOVERFLOW on Windows nor Palm 6.0 +#if !defined(__WXMSW__) && !defined(__WXPALMOS__) + || errno != EOVERFLOW +#endif + ) { // ok, there was enough space break;