From 566218ee415891fb5c0048968e9b6a9b86da350c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C5=8Dshin?= Date: Sat, 15 Jun 2024 10:37:11 -0700 Subject: [PATCH] memcpy by a constant --- ctl/string.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ctl/string.cc b/ctl/string.cc index 327e0f996..503ade6a8 100644 --- a/ctl/string.cc +++ b/ctl/string.cc @@ -91,7 +91,7 @@ string::reserve(size_t c2) noexcept if (!isbig()) { if (!(p2 = (char*)malloc(c2))) __builtin_trap(); - memcpy(p2, data(), size() + 1); + memcpy(p2, data(), __::string_size); } else { if (!(p2 = (char*)realloc(big()->p, c2))) __builtin_trap();