1
0
mirror of https://github.com/Tha14/toxic.git synced 2025-07-03 12:16:44 +02:00

cleanup: fix some uninitialized memory warnings and clarify some logic

This commit is contained in:
jfreegman
2021-12-13 12:33:52 -05:00
parent bf1e1b73fc
commit 3f18c6f8de
5 changed files with 27 additions and 23 deletions

View File

@ -148,9 +148,10 @@ static int print_n_chars(WINDOW *win, const char *s, size_t n, int max_y)
int x;
int y;
UNUSED_VAR(x);
getyx(win, y, x);
UNUSED_VAR(x);
// make sure cursor will wrap correctly after newline to prevent display bugs
if (y + 1 >= max_y) {
return -1;
@ -324,10 +325,10 @@ static void line_info_init_line(ToxWindow *self, struct line_info *line)
{
int y2;
int x2;
UNUSED_VAR(y2);
getmaxyx(self->window, y2, x2);
UNUSED_VAR(y2);
const int max_y = y2 - CHATBOX_HEIGHT - WINDOW_BAR_HEIGHT;
const int max_x = self->show_peerlist ? x2 - 1 - SIDEBAR_WIDTH : x2;
@ -522,10 +523,10 @@ void line_info_print(ToxWindow *self)
while (line && numlines++ <= max_y && print_ret == 0) {
int y;
int x;
UNUSED_VAR(y);
getyx(win, y, x);
UNUSED_VAR(y);
if (x > 0) { // Prevents us from printing off the screen
break;
}