From a99487eac8e93c887e23e524b31e03904b318669 Mon Sep 17 00:00:00 2001 From: Patrik Flykt Date: Wed, 22 May 2013 12:21:34 +0300 Subject: [PATCH] client: Reserve space for trailing NULL in the array --- client/input.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/input.c b/client/input.c index a6eb136..78f68a9 100644 --- a/client/input.c +++ b/client/input.c @@ -96,7 +96,7 @@ static void rl_handler(char *input) args = g_strsplit(input, " ", 0); num = g_strv_length(args); - trim_args = g_new0(char *, num); + trim_args = g_new0(char *, num + 1); for (i = 0, len = 0; i < num; i++) { if (*args[i] != '\0') { trim_args[len] = args[i]; -- 2.7.4