aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/commands.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/commands.c b/src/commands.c
index 3808929..25ec702 100644
--- a/src/commands.c
+++ b/src/commands.c
@@ -27,10 +27,10 @@ static char *join_str_list(struct list *list, const char *sep, size_t start)
assert(buf);
}
- strncat(buf, list->items[i], cap);
+ strncat(buf, list->items[i], cap - 1);
len += item_len;
- strncat(buf, sep, cap);
+ strncat(buf, sep, cap - 1);
len += sep_len;
}
return buf;