1
0
mirror of https://github.com/profanity-im/profanity.git synced 2024-12-04 14:46:46 -05:00

since we keep track of length correctly, we don't need to add a null terminator for sys_write

This commit is contained in:
Will Song 2015-11-23 20:30:48 -06:00
parent f73f88c571
commit 4501231eb3
No known key found for this signature in database
GPG Key ID: F2B1A34F21A171E2

View File

@ -802,7 +802,7 @@ static void
writecsv(int fd, const char *const str){ writecsv(int fd, const char *const str){
if(!str) return; if(!str) return;
size_t len = strlen(str); size_t len = strlen(str);
char *s = malloc((2 * len + 1) * sizeof(char)); char *s = malloc(2 * len * sizeof(char));
char *c = s; char *c = s;
for(int i = 0; i < strlen(str); i++){ for(int i = 0; i < strlen(str); i++){
if(str[i] != '"') *c++ = str[i]; if(str[i] != '"') *c++ = str[i];