memcpy by a constant

This commit is contained in:
Jōshin 2024-06-15 10:37:11 -07:00
parent c7a114db77
commit 566218ee41
No known key found for this signature in database

View file

@ -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();