diff --git a/src/common/string.cpp b/src/common/string.cpp index aa150ea4af..672b5b143b 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -42,6 +42,7 @@ #include #include #include +#include #ifdef __SALFORDC__ #include @@ -1835,7 +1836,9 @@ 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) || errno != EOVERFLOW ) { // ok, there was enough space break;