From 6c8d0db34bd485084ffb2108620b396c8056251e Mon Sep 17 00:00:00 2001 From: Clement Sibille Date: Sun, 9 Jun 2024 01:05:57 +0900 Subject: Fix Playdate support --- src/lisiblestd/string.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/lisiblestd/string.c') diff --git a/src/lisiblestd/string.c b/src/lisiblestd/string.c index 2b191b2..e7ef28c 100644 --- a/src/lisiblestd/string.c +++ b/src/lisiblestd/string.c @@ -12,7 +12,7 @@ String String_new(Allocator *allocator, const char *str) { char *value = Allocator_allocate(allocator, length + 1); LSTD_ASSERT(value != NULL); - strncpy(value, str, length); + strncpy(value, str, length + 1); value[length] = '\0'; return (String){.value = value, .length = length}; -- cgit v1.2.3