]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
bug in wxString::Printf() corrected (the length of the string wasn't updated
[wxWidgets.git] / src / common / string.cpp
index 9d056390460addaaaf1d1c1bd676bcabe599b3db..03e3ac1516a6fe36df13f133439612909083830c 100644 (file)
@@ -345,6 +345,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
 }