mirror of
https://github.com/Tha14/toxic.git
synced 2024-11-26 14:13:27 +01:00
endwin needs to come first
This commit is contained in:
parent
c061895266
commit
35cd2a2914
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
@ -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);
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user