1
0
mirror of https://github.com/Tha14/toxic.git synced 2024-12-23 15:23:26 +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) {
fprintf(stderr, "malloc() failed. Aborting...\n");
endwin();
fprintf(stderr, "malloc() failed. Aborting...\n");
exit(EXIT_FAILURE);
}
@ -548,8 +548,8 @@ ToxWindow new_chat(Tox *m, ToxWindow *prompt, int friendnum)
ret.x = x;
ret.s = s;
} else {
fprintf(stderr, "calloc() failed. Aborting...\n");
endwin();
fprintf(stderr, "calloc() failed. Aborting...\n");
exit(EXIT_FAILURE);
}

View File

@ -134,9 +134,9 @@ 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);
fprintf(stderr, "select_friend() failed. Aborting...\n");
exit(EXIT_FAILURE);
}

View File

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

View File

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

View File

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