]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
wxObjArray fix (part 2)
[wxWidgets.git] / src / common / string.cpp
index 9d056390460addaaaf1d1c1bd676bcabe599b3db..e00c8180332fec29d9a58bf666b4290d8722a063 100644 (file)
@@ -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
 }