Skip to content

Commit c9da26a

Browse files
committed
alternative oob solution
1 parent 4f22a54 commit c9da26a

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

src/zsv.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -458,12 +458,22 @@ enum zsv_status zsv_finish(struct zsv_scanner *scanner) {
458458
}
459459
if (scanner->quote_close_position > 0 &&
460460
scanner->cell_start + scanner->quote_close_position >= scanner->buff.size) {
461+
// the below does not work if !scanner->free_buff
462+
// use scanner_pre_parse() instead to shift the row over
463+
// then append '"' to the end
464+
size_t new_end = scanner->buff.size - scanner->row_start;
465+
466+
scanner_pre_parse(scanner);
467+
scanner->buff.buff[new_end] = '"';
468+
/*
461469
size_t new_size = scanner->cell_start + scanner->quote_close_position + 1;
470+
462471
void *mem = realloc(scanner->buff.buff, new_size);
463472
if (!mem)
464473
return zsv_status_memory;
465474
scanner->buff.buff = mem;
466475
scanner->buff.size = new_size;
476+
*/
467477
}
468478
}
469479

0 commit comments

Comments
 (0)