diff options
| author | 2026-08-25 12:47:03 -0400 | |
|---|---|---|
| committer | 2026-08-25 12:47:03 -0400 | |
| commit | 5d03133a3ea48721033e3c884181d562be106d2f (patch) | |
| tree | e8098010f88f41c15dbe0f44addcfe3fe602703f /tests | |
| parent | ca45c8b338fb8f017ae77a3f990c2cb5f379f131 (diff) | |
| download | libalabaster-5d03133a3ea48721033e3c884181d562be106d2f.tar.gz libalabaster-5d03133a3ea48721033e3c884181d562be106d2f.tar.bz2 libalabaster-5d03133a3ea48721033e3c884181d562be106d2f.zip | |
str: Fix to_c_str() when length is MAX_ALLOC_32
Signed-off-by: Andrew Opalach <andrew@akon.city>
Diffstat (limited to 'tests')
| -rw-r--r-- | tests/str.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/tests/str.c b/tests/str.c index c783673..933b1f9 100644 --- a/tests/str.c +++ b/tests/str.c @@ -344,6 +344,9 @@ static bool str_test_limits(void) } al_str_cat(&s, &al_str_c("x")); + char *c_str = al_str_to_c_str(&s); + AL_TEST_TRUE(al_strlen(c_str) == MAX_ALLOC_32); + AL_TEST_TRUE(al_str_atr(&s, 1) == 'x'); AL_TEST_TRUE(al_str_at(&s, MAX_ALLOC_32 - 1) == 'x'); AL_TEST_TRUE(al_str_atr(&s, 2) == 'y'); |