]> git.saurik.com Git - wxWidgets.git/blobdiff - src/common/string.cpp
Some doc corrections; Watcom C++ corrections; VC++ 4 corrections
[wxWidgets.git] / src / common / string.cpp
index fd6ee0a7800b51fd2a2db3283c402c8b2480705f..3f8cfe19fd3f990a112a267bf773fe46688b2ae9 100644 (file)
@@ -290,11 +290,11 @@ void wxString::InitWith(const wxChar *psz, size_t nPos, size_t nLength)
 {
   Init();
 
-  wxASSERT( nPos <= wxStrlen(psz) );
-
   if ( nLength == wxSTRING_MAXLEN )
     nLength = wxStrlen(psz + nPos);
 
+  wxASSERT_MSG( nPos + nLength <= wxStrlen(psz), _T("index out of bounds") );
+
   STATISTICS_ADD(InitialLength, nLength);
 
   if ( nLength > 0 ) {
@@ -528,6 +528,12 @@ void wxString::UngetWriteBuf()
   GetStringData()->Validate(TRUE);
 }
 
+void wxString::UngetWriteBuf(size_t nLen)
+{
+  GetStringData()->nDataLength = nLen;
+  GetStringData()->Validate(TRUE);
+}
+
 // ---------------------------------------------------------------------------
 // data access
 // ---------------------------------------------------------------------------