X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/94ac840b49616e27ef30da6824aba9ec5c8321e7..7e4fb3b8168f4f2dbf2f8a246d3e094a8ccba194:/src/common/string.cpp diff --git a/src/common/string.cpp b/src/common/string.cpp index aa150ea4af..c95d6729e8 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 @@ -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 nor OpenVMS +#if !defined(__WXMSW__) && !defined(__WXPALMOS__) && !defined( __VMS ) + || errno != EOVERFLOW +#endif + ) { // ok, there was enough space break;