From: Vadim Zeitlin Date: Sun, 12 Jul 1998 22:06:28 +0000 (+0000) Subject: added missing UngetWriteBuf() in wxString::insert X-Git-Url: https://git.saurik.com/wxWidgets.git/commitdiff_plain/abc79986869dd899ded3f707943d77493f3228d8 added missing UngetWriteBuf() in wxString::insert git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@241 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775 --- diff --git a/src/common/string.cpp b/src/common/string.cpp index 1c8cd5319c..3031ae6daf 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -61,8 +61,6 @@ static int g_strEmpty[] = { -1, // ref count (locked) 0, // current length 0, // allocated memory 0 }; // string data -// empty string shares memory with g_strEmpty -static wxStringData *g_strNul = (wxStringData*)&g_strEmpty; // empty C style string: points to 'string data' byte of g_strEmpty extern const char *g_szNul = (const char *)(&g_strEmpty[3]); @@ -993,6 +991,7 @@ wxString& wxString::insert(size_t nPos, const wxString& str) strncpy(pc, c_str(), nPos); strcpy(pc + nPos, str); strcpy(pc + nPos + str.Len(), c_str() + nPos); + strTmp.UngetWriteBuf(); *this = strTmp; return *this;