[Base] StringBuffer: Clear the C string in Reset

This commit is contained in:
Triang3l 2018-11-10 16:33:40 +03:00 committed by GitHub
parent 128fb32698
commit c949ce3d9c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 1 deletions

View File

@ -27,7 +27,10 @@ StringBuffer::~StringBuffer() {
buffer_ = nullptr;
}
void StringBuffer::Reset() { buffer_offset_ = 0; }
void StringBuffer::Reset() {
buffer_offset_ = 0;
buffer_[0] = 0;
}
void StringBuffer::Grow(size_t additional_length) {
if (buffer_offset_ + additional_length <= buffer_capacity_) {