summaryrefslogtreecommitdiff
path: root/arr.c
diff options
context:
space:
mode:
Diffstat (limited to 'arr.c')
-rw-r--r--arr.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/arr.c b/arr.c
index 9d2220b..2fa9b6b 100644
--- a/arr.c
+++ b/arr.c
@@ -223,7 +223,8 @@ static void arrcstr_append_strn_(char **a, char const *s, size_t s_len) {
size_t new_len = curr_len + s_len;
arr_reserve(*a, new_len + 1);
arr_set_len(*a, new_len);
- memcpy(*a + curr_len, s, s_len + 1);
+ memcpy(*a + curr_len, s, s_len);
+ (*a)[curr_len + s_len] = '\0';
}
static void arrcstr_shrink_(char **a, u32 new_len) {