From 4501231eb312f8a449101966470eee85e37c7b66 Mon Sep 17 00:00:00 2001 From: Will Song Date: Mon, 23 Nov 2015 20:30:48 -0600 Subject: [PATCH] since we keep track of length correctly, we don't need to add a null terminator for sys_write --- src/command/commands.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/command/commands.c b/src/command/commands.c index e6082bd8..ef2de3b1 100644 --- a/src/command/commands.c +++ b/src/command/commands.c @@ -802,7 +802,7 @@ static void writecsv(int fd, const char *const str){ if(!str) return; size_t len = strlen(str); - char *s = malloc((2 * len + 1) * sizeof(char)); + char *s = malloc(2 * len * sizeof(char)); char *c = s; for(int i = 0; i < strlen(str); i++){ if(str[i] != '"') *c++ = str[i];