summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas Kling <awesomekling@gmail.com>2019-04-15 23:56:35 +0200
committerAndreas Kling <awesomekling@gmail.com>2019-04-15 23:56:35 +0200
commit30b0e5f82ee72ee78b202506b4e12f7992af270d (patch)
tree27dcd65529199f21b309e910b20a7c422f0adf0a
parentfa89446cb6a5276925ec4cbf41b0f0d967304009 (diff)
downloadserenity-30b0e5f82ee72ee78b202506b4e12f7992af270d.zip
AK: Make StringBuilder::appendf() pre-allocate the format string length.
-rw-r--r--AK/StringBuilder.cpp1
1 files changed, 1 insertions, 0 deletions
diff --git a/AK/StringBuilder.cpp b/AK/StringBuilder.cpp
index 8eb7479aea..08776dd3f3 100644
--- a/AK/StringBuilder.cpp
+++ b/AK/StringBuilder.cpp
@@ -52,6 +52,7 @@ void StringBuilder::appendf(const char* fmt, ...)
{
va_list ap;
va_start(ap, fmt);
+ will_append(strlen(fmt));
appendvf(fmt, ap);
va_end(ap);
}