X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/846b6c86586ff3c5a1948132761ba223f3ccb75c..ee6a122fa3446c7aa020e7fdfeb85584d92309d1:/include/wx/buffer.h diff --git a/include/wx/buffer.h b/include/wx/buffer.h index 800c41b714..6d98f6e286 100644 --- a/include/wx/buffer.h +++ b/include/wx/buffer.h @@ -312,6 +312,10 @@ public: if ( !str ) return false; + // For consistency with the ctor taking just the length, NUL-terminate + // the buffer. + str[len] = (CharType)0; + if ( this->m_data == this->GetNullData() ) { this->m_data = new Data(str, len); @@ -434,7 +438,7 @@ public: friend class wxMemoryBuffer; - // everyting is private as it can only be used by wxMemoryBuffer + // everything is private as it can only be used by wxMemoryBuffer private: wxMemoryBufferData(size_t size = wxMemoryBufferData::DefBufSize) : m_data(size ? malloc(size) : NULL), m_size(size), m_len(0), m_ref(0)