mirror of
https://git.jabber.space/devs/cproof.git
synced 2026-07-28 20:46:22 +00: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:
@@ -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];
|
||||||
|
|||||||
Reference in New Issue
Block a user