From 0e4c526094cfc0facb925c6b20d5e1aee0242bb6 Mon Sep 17 00:00:00 2001 From: Andrew Noyes Date: Wed, 3 Sep 2025 12:16:02 -0400 Subject: [PATCH] Fix realloc bug in static_format --- src/format.hpp | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/format.hpp b/src/format.hpp index 0db9158..ace8d93 100644 --- a/src/format.hpp +++ b/src/format.hpp @@ -270,7 +270,6 @@ std::string_view static_format(ArenaAllocator &arena, Ts &&...ts) { char *buf = result; (detail::term(ts).write(buf), ...); const int size = static_cast(buf - result); - return std::string_view( - arena.realloc(result, upper_bound, upper_bound - size), - static_cast(size)); + return std::string_view(arena.realloc(result, upper_bound, size), + static_cast(size)); }