Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix recent bug in writer that closed stream, which should be left to caller to manage #307

Merged
merged 1 commit into from
Nov 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions app/utils/writer.c
Original file line number Diff line number Diff line change
Expand Up @@ -196,10 +196,12 @@ enum zsv_writer_status zsv_writer_delete(zsv_csv_writer w) {
if (w->started)
w->out.write("\n", 1, 1, w->out.stream);

/* closing the stream should be handled by whatever code first opened the stream
if (w->out.stream && w->out.stream != stdout) {
fclose(w->out.stream);
w->out.stream = NULL;
}
*/

if (w->out.buff)
free(w->out.buff);
Expand Down