mirror of
https://github.com/Tha14/toxic.git
synced 2025-06-27 13:06:45 +02:00
Fix a bunch of misc bugs and corner cases
This commit is contained in:
13
src/chat.c
13
src/chat.c
@ -795,6 +795,10 @@ static void init_infobox(ToxWindow *self)
|
||||
|
||||
int x2, y2;
|
||||
getmaxyx(self->window, y2, x2);
|
||||
|
||||
if (y2 <= 0 || x2 <= 0)
|
||||
return;
|
||||
|
||||
(void) y2;
|
||||
|
||||
memset(&ctx->infobox, 0, sizeof(struct infobox));
|
||||
@ -901,7 +905,7 @@ static void chat_onKey(ToxWindow *self, Tox *m, wint_t key, bool ltr)
|
||||
getyx(self->window, y, x);
|
||||
getmaxyx(self->window, y2, x2);
|
||||
|
||||
if (x2 <= 0)
|
||||
if (y2 <= 0 || x2 <= 0)
|
||||
return;
|
||||
|
||||
if (self->help->active) {
|
||||
@ -999,6 +1003,9 @@ static void chat_onDraw(ToxWindow *self, Tox *m)
|
||||
int x2, y2;
|
||||
getmaxyx(self->window, y2, x2);
|
||||
|
||||
if (y2 <= 0 || x2 <= 0)
|
||||
return;
|
||||
|
||||
ChatContext *ctx = self->chatwin;
|
||||
|
||||
pthread_mutex_lock(&Winthread.lock);
|
||||
@ -1123,6 +1130,10 @@ static void chat_onInit(ToxWindow *self, Tox *m)
|
||||
curs_set(1);
|
||||
int x2, y2;
|
||||
getmaxyx(self->window, y2, x2);
|
||||
|
||||
if (y2 <= 0 || x2 <= 0)
|
||||
exit_toxic_err("failed in chat_onInit", FATALERR_CURSES);
|
||||
|
||||
self->x = x2;
|
||||
|
||||
/* Init statusbar info */
|
||||
|
Reference in New Issue
Block a user