Commit: c115b11b14c62c1fc295baa43213c6bf8e892581
Parent: 41b9f675f70e1b35f9b52b733470f807b913109d
Author: Randy Palamar
Date: Tue, 25 Feb 2025 09:33:17 -0700
core: push_s8_zero: returned string shouldn't know about the extra 0
Diffstat:
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/util.c b/util.c
@@ -425,7 +425,8 @@ push_s8(Arena *a, s8 str)
static s8
push_s8_zero(Arena *a, s8 str)
{
- s8 result = s8_alloc(a, str.len + 1);
+ s8 result = s8_alloc(a, str.len + 1);
+ result.len -= 1;
mem_copy(str.data, result.data, result.len);
return result;
}