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:
parent
f73f88c571
commit
4501231eb3
@ -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];
|
||||||
|
Loading…
Reference in New Issue
Block a user