summaryrefslogtreecommitdiff
path: root/src/string.cc
diff options
context:
space:
mode:
authorMaxime Coste <mawww@kakoune.org>2019-11-17 09:50:18 +1100
committerMaxime Coste <mawww@kakoune.org>2019-11-17 09:50:18 +1100
commit5378dabdecccd3158f9bb317499ece365563650b (patch)
tree23917180fdfa7c07c28fc954c6a15532b096f1ce /src/string.cc
parente33ba455c867fabd671d9fd7c883ff65ed632e5d (diff)
Fix String::resize not zero-terminating
Diffstat (limited to 'src/string.cc')
-rw-r--r--src/string.cc1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/string.cc b/src/string.cc
index d44963ba..b5f04f29 100644
--- a/src/string.cc
+++ b/src/string.cc
@@ -147,6 +147,7 @@ void String::resize(ByteCount size, char c)
for (auto i = current_size; i < target_size; ++i)
m_data.data()[i] = c;
}
+ data()[target_size] = 0;
}
void String::Data::set_size(size_t size)