1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-05 02:36:45 +02:00

made error handling more consistent and added exit function

This commit is contained in:
Jfreegman
2013-09-11 00:02:27 -04:00
parent 2e84836f8c
commit 40dcfc82d2
6 changed files with 21 additions and 23 deletions

View File

@ -17,8 +17,6 @@
#include "friendlist.h"
extern char *DATA_FILE;
extern int store_data(Tox *m, char *path);
extern ToxWindow *prompt;
typedef struct {
@ -136,9 +134,10 @@ static void select_friend(Tox *m, wint_t key)
} else return; /* Bad key input */
/* If we reach this something is wrong */
fprintf(stderr, "select_friend() failed. Aborting...\n");
endwin();
tox_kill(m);
exit(2);
exit(EXIT_FAILURE);
}
static void delete_friend(Tox *m, ToxWindow *self, int f_num, wint_t key)