another potential getline bug

This commit is contained in:
SuperNovaa41 2024-01-25 09:41:08 -05:00
parent 5c06dbca6c
commit e9014258a8

View File

@ -91,6 +91,8 @@ void remove_line_from_file(int id_to_remove)
fclose(new_csv); fclose(new_csv);
fclose(csv); fclose(csv);
free(line); // man pages say this should be freed
remove(FILE_NAME); remove(FILE_NAME);
rename("temp.csv", FILE_NAME); // new csv is now the original file, without that line rename("temp.csv", FILE_NAME); // new csv is now the original file, without that line
} }