summaryrefslogtreecommitdiffstats
path: root/src/lisiblestd/string.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/lisiblestd/string.c')
-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