about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorWill Song <incertia9474@gmail.com>2015-11-23 20:30:48 -0600
committerWill Song <incertia9474@gmail.com>2015-11-23 20:30:48 -0600
commit4501231eb312f8a449101966470eee85e37c7b66 (patch)
tree7db937bdeee3a52eafe5981edc95269db6982fb1
parentf73f88c571a559d8d441a9090e938ceec6725131 (diff)
downloadprofani-tty-4501231eb312f8a449101966470eee85e37c7b66.tar.gz
since we keep track of length correctly, we don't need to add a null terminator for sys_write
-rw-r--r--src/command/commands.c2
1 files changed, 1 insertions, 1 deletions
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];