Skip to content

Commit 5a3443e

Browse files
committed
fixed bug in LineReader that could cause a segfault in rare cases where the input file was missing a final newline
1 parent dd2db82 commit 5a3443e

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

csv.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ namespace io{
474474
throw err;
475475
}
476476

477-
if(buffer[line_end] == '\n'){
477+
if(buffer[line_end] == '\n' && line_end != data_end){
478478
buffer[line_end] = '\0';
479479
}else{
480480
// some files are missing the newline at the end of the

0 commit comments

Comments
 (0)