]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
commented out more unused code (bcc compilation warning)
[wxWidgets.git] / src / common / string.cpp
index e7ab5d2615212a8d975284cec81b404a260d9f9f..8f20b9ac13d3a347fae78413cab446ac81078d71 100644 (file)
@@ -1815,9 +1815,11 @@ int wxString::PrintfV(const wxChar* pszFormat, va_list argptr)
             // current size of the buffer
             size *= 2;
         }
-        else if ( len > size )
+        else if ( len >= size )
         {
-            size = len;
+            // some vsnprintf() implementations NUL-terminate the buffer and
+            // some don't in len == size case, to be safe always add 1
+            size = len + 1;
         }
         else // ok, there was enough space
         {