X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/607d9061788c0277705f9c9c16ca00a22b019918..7798a18ec81d3733082bc60a958fac1d4510faca:/src/common/string.cpp diff --git a/src/common/string.cpp b/src/common/string.cpp index 6247bb0fab..2b95e23f12 100644 --- a/src/common/string.cpp +++ b/src/common/string.cpp @@ -153,7 +153,7 @@ wxString::wxString(char ch, size_t nLength) if ( nLength > 0 ) { AllocBuffer(nLength); - + wxASSERT( sizeof(char) == 1 ); // can't use memset if not memset(m_pchData, ch, nLength); @@ -282,14 +282,14 @@ void wxString::AllocBeforeWrite(size_t nLen) wxASSERT( nLen != 0 ); // doesn't make any sense // must not share string and must have enough space - register wxStringData* pData = GetStringData(); + register wxStringData* pData = GetStringData(); if ( pData->IsShared() || (nLen > pData->nAllocLength) ) { // can't work with old buffer, get new one pData->Unlock(); AllocBuffer(nLen); } - wxASSERT( !pData->IsShared() ); // we must be the only owner + wxASSERT( !GetStringData()->IsShared() ); // we must be the only owner } // get the pointer to writable buffer of (at least) nLen bytes @@ -862,6 +862,7 @@ int wxString::PrintfV(const char* pszFormat, va_list argptr) return iLen; } +#if 0 int wxString::Scanf(const char *pszFormat, ...) const { va_list argptr; @@ -883,6 +884,7 @@ int wxString::ScanfV(const char *pszFormat, va_list argptr) const return vsscanf(c_str(), pszFormat, argptr); #endif } +#endif // --------------------------------------------------------------------------- // standard C++ library string functions @@ -894,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);