]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
Reverted fragment
[wxWidgets.git] / src / common / string.cpp
index 8415f0c3f31e56562a50012a959b7faab0231f78..503ff915c9da4de181590e9091c97d06727f3ed7 100644 (file)
@@ -1685,7 +1685,10 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
             buf[size] = _T('\0');
         }
 
-        if ( len >= 0 )
+        // 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 )
         {
             // ok, there was enough space
             break;