X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/1fc5dd6f8eb590992150b3998266fb50dfaab227..09d27bb4446b4d54605190b9ebcf88a808274f58:/src/common/string.cpp diff --git a/src/common/string.cpp b/src/common/string.cpp index 9d05639046..e00c818033 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -106,8 +106,10 @@ extern const char *g_szNul = &g_strEmpty.dummy; // always available), but it's unsafe because it doesn't check for buffer // size - so give a warning #define wxVsprintf(buffer,len,format,argptr) vsprintf(buffer,format, argptr) +#ifndef __SC__ #pragma message("Using sprintf() because no snprintf()-like function defined") #endif +#endif // ---------------------------------------------------------------------------- // global functions @@ -345,6 +347,10 @@ void wxString::AllocBeforeWrite(size_t nLen) pData->Unlock(); AllocBuffer(nLen); } + else { + // update the string length + pData->nDataLength = nLen; + } wxASSERT( !GetStringData()->IsShared() ); // we must be the only owner }