summaryrefslogtreecommitdiffstats
path: root/src/lisiblestd/string.c
diff options
context:
space:
mode:
authorClement Sibille <clements+github@lisible.xyz>2024-06-09 01:05:57 +0900
committerClement Sibille <clements+github@lisible.xyz>2024-06-09 01:05:57 +0900
commit6c8d0db34bd485084ffb2108620b396c8056251e (patch)
tree71c37a768a8f5c174778f2a3fbc3149be5ba473f /src/lisiblestd/string.c
parentff2cfc706efd88c2e30fdb4c27ddad3263227367 (diff)
Fix Playdate support
Diffstat (limited to '')
-rw-r--r--src/lisiblestd/string.c2
1 files changed, 1 insertions, 1 deletions
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};
Go back to lisible.xyz