Skip to content

Commit

Permalink
refactor: Terminate ncurses before writing error message to stderr.
Browse files Browse the repository at this point in the history
  • Loading branch information
iphydf committed Feb 18, 2024
1 parent 146649b commit e11f487
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/toxic.c
Original file line number Diff line number Diff line change
Expand Up @@ -155,11 +155,12 @@ void exit_toxic_success(Toxic *toxic)

void exit_toxic_err(const char *errmsg, int errcode)
{
endwin();

if (freopen("/dev/tty", "w", stderr)) {
fprintf(stderr, "Toxic session aborted with error code %d (%s)\n", errcode, errmsg);
}

endwin();
exit(EXIT_FAILURE);
}

Expand Down

0 comments on commit e11f487

Please sign in to comment.