mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-22 22:53:03 +01:00
fix invalid usage of stderr and incorrect formatting
This commit is contained in:
parent
1303053a27
commit
ff1620c923
@ -1031,7 +1031,7 @@ static void friendlist_onDraw(ToxWindow *self, Tox *m)
|
|||||||
wprintw(self->window, " Online: ");
|
wprintw(self->window, " Online: ");
|
||||||
wattroff(self->window, A_BOLD);
|
wattroff(self->window, A_BOLD);
|
||||||
|
|
||||||
wprintw(self->window, "%d/%d \n\n", Friends.num_online, Friends.num_friends);
|
wprintw(self->window, "%zu/%zu \n\n", Friends.num_online, Friends.num_friends);
|
||||||
|
|
||||||
if ((y2 - FLIST_OFST) <= 0) {
|
if ((y2 - FLIST_OFST) <= 0) {
|
||||||
return;
|
return;
|
||||||
|
@ -391,7 +391,7 @@ void line_info_print(ToxWindow *self)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
wprintw(win, "\n", line->msg);
|
wprintw(win, "\n");
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case OUT_ACTION_READ:
|
case OUT_ACTION_READ:
|
||||||
|
11
src/toxic.c
11
src/toxic.c
@ -129,12 +129,12 @@ static void catch_SIGSEGV(int sig)
|
|||||||
{
|
{
|
||||||
UNUSED_VAR(sig);
|
UNUSED_VAR(sig);
|
||||||
|
|
||||||
if (!freopen("/dev/tty", "w", stderr)) { // make sure stderr is enabled since we may have disabled it
|
if (freopen("/dev/tty", "w", stderr)) { // make sure stderr is enabled since we may have disabled it
|
||||||
fprintf(stderr, "Warning: Failed to enable stderr\n");
|
fprintf(stderr, "Caught SIGSEGV: Aborting toxic session.\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
endwin();
|
endwin();
|
||||||
fprintf(stderr, "Caught SIGSEGV: Aborting toxic session.\n");
|
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -216,12 +216,11 @@ void exit_toxic_err(const char *errmsg, int errcode)
|
|||||||
{
|
{
|
||||||
free_global_data();
|
free_global_data();
|
||||||
|
|
||||||
if (!freopen("/dev/tty", "w", stderr)) {
|
if (freopen("/dev/tty", "w", stderr)) {
|
||||||
fprintf(stderr, "Warning: Failed to open stderr\n");
|
fprintf(stderr, "Toxic session aborted with error code %d (%s)\n", errcode, errmsg);
|
||||||
}
|
}
|
||||||
|
|
||||||
endwin();
|
endwin();
|
||||||
fprintf(stderr, "Toxic session aborted with error code %d (%s)\n", errcode, errmsg);
|
|
||||||
exit(EXIT_FAILURE);
|
exit(EXIT_FAILURE);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user