From 14670defd904078ca45e11eb51f3cc6f236fb8f3 Mon Sep 17 00:00:00 2001 From: Julien Danjou Date: Sat, 11 Oct 2008 11:18:15 +0200 Subject: [PATCH] util: fix strsplit end buffer Signed-off-by: Julien Danjou --- common/util.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/util.c b/common/util.c index 2116cfe8..c49588a1 100644 --- a/common/util.c +++ b/common/util.c @@ -255,7 +255,7 @@ a_strsplit(const char *str, ssize_t len, char delim) if(str[i] == delim) n++; - retval = p_new(char *, n); + retval = p_new(char *, n + 1); for(i = 0, comp = 0; comp < n; comp++) {