diff options
author | Will Song <incertia9474@gmail.com> | 2015-11-23 20:30:48 -0600 |
---|---|---|
committer | Will Song <incertia9474@gmail.com> | 2015-11-23 20:30:48 -0600 |
commit | 4501231eb312f8a449101966470eee85e37c7b66 (patch) | |
tree | 7db937bdeee3a52eafe5981edc95269db6982fb1 /src/command | |
parent | f73f88c571a559d8d441a9090e938ceec6725131 (diff) | |
download | profani-tty-4501231eb312f8a449101966470eee85e37c7b66.tar.gz |
since we keep track of length correctly, we don't need to add a null terminator for sys_write
Diffstat (limited to 'src/command')
-rw-r--r-- | src/command/commands.c | 2 |
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]; |