Avoid passing NULL pointers to curses functions.
This allows profanity to work without segfaulting from NULL pointer dereferences when used with NetBSD libcurses. Basic functionality was tested, there may be more NULL pointer issues hiding.
This commit is contained in:
@@ -1863,7 +1863,12 @@ win_sub_print(WINDOW* win, char* msg, gboolean newline, gboolean wrap, int inden
|
||||
void
|
||||
win_sub_newline_lazy(WINDOW* win)
|
||||
{
|
||||
int curx = getcurx(win);
|
||||
int curx;
|
||||
|
||||
if (win == NULL) {
|
||||
return;
|
||||
}
|
||||
curx = getcurx(win);
|
||||
if (curx > 0) {
|
||||
int cury = getcury(win);
|
||||
wmove(win, cury + 1, 0);
|
||||
|
||||
Reference in New Issue
Block a user