X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/c15b8bfd6fbc605fcf5f77faf713e6cebe3f456e..a55d039a23c730975a8b5efedab6b4940fb4009b:/src/common/string.cpp?ds=inline diff --git a/src/common/string.cpp b/src/common/string.cpp index ffae5b4e12..c2abb44c19 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -39,10 +39,6 @@ #include #include -#ifndef __WXMSW__ -#include -#endif - #ifdef __SALFORDC__ #include #endif @@ -365,8 +361,8 @@ bool wxStringBase::Alloc(size_t nLen) if ( pData->IsEmpty() ) { nLen += EXTRA_ALLOC; - wxStringData* pData = (wxStringData*) - malloc(sizeof(wxStringData) + (nLen + 1)*sizeof(wxChar)); + pData = (wxStringData *) + malloc(sizeof(wxStringData) + (nLen + 1)*sizeof(wxChar)); if ( pData == NULL ) { // allocation failure handled by caller @@ -1839,23 +1835,13 @@ 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 + // buffer were large enough (newer standards such as Unix98) if ( len >= 0 && len <= size ) { // ok, there was enough space break; } -#ifdef EOVERFLOW - // if the error is not due to not having enough space (it could be e.g. - // EILSEQ), break too -- we'd just eat all available memory uselessly - if ( errno != EOVERFLOW ) - { - // no sense in continuing - break; - } -#endif // EOVERFLOW - // still not enough, double it again size *= 2; }