]> git.saurik.com Git - wxWidgets.git/commitdiff
corrected "of by 1" error in wxString::insert()
authorVadim Zeitlin <vadim@wxwidgets.org>
Fri, 26 Jun 1998 15:39:01 +0000 (15:39 +0000)
committerVadim Zeitlin <vadim@wxwidgets.org>
Fri, 26 Jun 1998 15:39:01 +0000 (15:39 +0000)
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@148 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775

src/common/string.cpp

index 415a533501561901915533a4c83b979bd77df2dd..2b95e23f128551afd99a87ba9d824463de4cd607 100644 (file)
@@ -896,7 +896,7 @@ wxString& wxString::insert(size_t nPos, const wxString& str)
   wxASSERT( nPos <= Len() );
 
   wxString strTmp;
-  char *pc = strTmp.GetWriteBuf(Len() + str.Len() + 1);
+  char *pc = strTmp.GetWriteBuf(Len() + str.Len());
   strncpy(pc, c_str(), nPos);
   strcpy(pc + nPos, str);
   strcpy(pc + nPos + str.Len(), c_str() + nPos);