]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
Insure suitable choices of path/drive separator on OS/2.
[wxWidgets.git] / src / common / string.cpp
index 8415f0c3f31e56562a50012a959b7faab0231f78..aa461904f498b58daab618ee883fb97f27159fc8 100644 (file)
@@ -168,6 +168,8 @@ wxSTD ostream& operator<<(wxSTD ostream& os, const wxString& str)
   #define STATISTICS_ADD(av, val)
 #endif // WXSTRING_STATISTICS
 
+#if !wxUSE_STL
+
 // ===========================================================================
 // wxStringData class deallocation
 // ===========================================================================
@@ -180,8 +182,6 @@ void wxStringData::Free()
 }
 #endif
 
-#if !wxUSE_STL
-
 // ===========================================================================
 // wxStringBase
 // ===========================================================================
@@ -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;
@@ -2322,12 +2325,12 @@ bool wxArrayString::operator==(const wxArrayString& a) const
 
 #endif // !wxUSE_STL
 
-int wxStringSortAscending(wxString* s1, wxString* s2)
+int wxCMPFUNC_CONV wxStringSortAscending(wxString* s1, wxString* s2)
 {
     return wxStrcmp(s1->c_str(), s2->c_str());
 }
 
-int wxStringSortDescending(wxString* s1, wxString* s2)
+int wxCMPFUNC_CONV wxStringSortDescending(wxString* s1, wxString* s2)
 {
     return -wxStrcmp(s1->c_str(), s2->c_str());
 }