X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/846b6c86586ff3c5a1948132761ba223f3ccb75c..6f41c10973643552837c6bd38b23779e65a2eaa3:/include/wx/buffer.h diff --git a/include/wx/buffer.h b/include/wx/buffer.h index 800c41b714..ec0e1fc765 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);