From 7f03a0a99daaa3df326f2904091affe55e910156 Mon Sep 17 00:00:00 2001 From: Tyge Løvset Date: Fri, 28 Oct 2022 09:39:48 +0200 Subject: Changed internal rep. for cstr to support 22 bytes small string instead of 23, in order to have 0-initialized strings to be valid empty strings. --- include/stc/forward.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include/stc/forward.h') diff --git a/include/stc/forward.h b/include/stc/forward.h index 39628fa0..2e0b3445 100644 --- a/include/stc/forward.h +++ b/include/stc/forward.h @@ -55,7 +55,7 @@ typedef struct { cstr_value* data; size_t size, cap; } cstr_buf; typedef struct { cstr_value* str; } cstr; #else typedef union { - struct { cstr_value data[sizeof(cstr_buf) - 1]; unsigned char last; } sml; + struct { cstr_value data[sizeof(cstr_buf) - 1]; unsigned char size; } sml; struct { cstr_value* data; size_t size, ncap; } lon; } cstr; #endif -- cgit v1.2.3