1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-11-23 05:03:01 +01:00

endwin needs to come first

This commit is contained in:
Jfreegman 2013-09-12 01:33:41 -04:00
parent c061895266
commit 35cd2a2914
5 changed files with 10 additions and 10 deletions

View File

@ -153,8 +153,8 @@ static uint8_t *wcs_to_char(wchar_t *string)
} }
if (ret == NULL) { if (ret == NULL) {
fprintf(stderr, "malloc() failed. Aborting...\n");
endwin(); endwin();
fprintf(stderr, "malloc() failed. Aborting...\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -548,8 +548,8 @@ ToxWindow new_chat(Tox *m, ToxWindow *prompt, int friendnum)
ret.x = x; ret.x = x;
ret.s = s; ret.s = s;
} else { } else {
fprintf(stderr, "calloc() failed. Aborting...\n");
endwin(); endwin();
fprintf(stderr, "calloc() failed. Aborting...\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

View File

@ -134,9 +134,9 @@ static void select_friend(Tox *m, wint_t key)
} else return; /* Bad key input */ } else return; /* Bad key input */
/* If we reach this something is wrong */ /* If we reach this something is wrong */
fprintf(stderr, "select_friend() failed. Aborting...\n");
endwin(); endwin();
tox_kill(m); tox_kill(m);
fprintf(stderr, "select_friend() failed. Aborting...\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

View File

@ -317,17 +317,17 @@ static void load_data(Tox *m, char *path)
buf = malloc(len); buf = malloc(len);
if (buf == NULL) { if (buf == NULL) {
fprintf(stderr, "malloc() failed. Aborting...\n");
fclose(fd); fclose(fd);
endwin(); endwin();
fprintf(stderr, "malloc() failed. Aborting...\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
if (fread(buf, len, 1, fd) != 1) { if (fread(buf, len, 1, fd) != 1) {
fprintf(stderr, "fread() failed. Aborting...\n");
free(buf); free(buf);
fclose(fd); fclose(fd);
endwin(); endwin();
fprintf(stderr, "fread() failed. Aborting...\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -347,8 +347,8 @@ static void load_data(Tox *m, char *path)
int st; int st;
if ((st = store_data(m, path)) != 0) { if ((st = store_data(m, path)) != 0) {
fprintf(stderr, "Store messenger failed with return code: %d\n", st);
endwin(); endwin();
fprintf(stderr, "Store messenger failed with return code: %d\n", st);
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }
@ -408,8 +408,8 @@ int main(int argc, char *argv[])
strcat(SRVLIST_FILE, CONFIGDIR); strcat(SRVLIST_FILE, CONFIGDIR);
strcat(SRVLIST_FILE, "DHTservers"); strcat(SRVLIST_FILE, "DHTservers");
} else { } else {
fprintf(stderr, "malloc() failed. Aborting...\n");
endwin(); endwin();
fprintf(stderr, "malloc() failed. Aborting...\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
} }

View File

@ -115,8 +115,8 @@ unsigned char *hex_string_to_bin(char hex_string[])
unsigned char *val = malloc(len); unsigned char *val = malloc(len);
if (val == NULL) { if (val == NULL) {
fprintf(stderr, "malloc() failed. Aborting...\n");
endwin(); endwin();
fprintf(stderr, "malloc() failed. Aborting...\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }
@ -699,8 +699,8 @@ ToxWindow new_prompt()
if (s != NULL) if (s != NULL)
ret.s = s; ret.s = s;
else { else {
fprintf(stderr, "calloc() failed. Aborting...\n");
endwin(); endwin();
fprintf(stderr, "calloc() failed. Aborting...\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }

View File

@ -195,8 +195,8 @@ ToxWindow *init_windows()
int n_prompt = add_window(m, new_prompt()); int n_prompt = add_window(m, new_prompt());
if (n_prompt == -1 || add_window(m, new_friendlist()) == -1) { if (n_prompt == -1 || add_window(m, new_friendlist()) == -1) {
fprintf(stderr, "add_window() failed. Aborting...\n");
endwin(); endwin();
fprintf(stderr, "add_window() failed. Aborting...\n");
exit(EXIT_FAILURE); exit(EXIT_FAILURE);
} }