X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fncurses.c;h=d5b5a63fac021f36a8c2a1bba6c395b99c148eaf;hp=2900034533458fc5efff503ac685f22988331f45;hb=6af42291adceeb1bd8caab41e16762ec6d96529c;hpb=950eed9ace2ceff30b88c20de1ef8a0ba05ac567 diff --git a/test/ncurses.c b/test/ncurses.c index 29000345..d5b5a63f 100644 --- a/test/ncurses.c +++ b/test/ncurses.c @@ -40,7 +40,7 @@ AUTHOR Author: Eric S. Raymond 1993 Thomas E. Dickey (beginning revision 1.27 in 1996). -$Id: ncurses.c,v 1.367 2011/04/23 21:16:43 tom Exp $ +$Id: ncurses.c,v 1.370 2011/09/17 21:57:49 tom Exp $ ***************************************************************************/ @@ -1394,7 +1394,7 @@ show_attr(int row, int skip, bool arrow, chtype attr, const char *name) if (!(termattrs() & test)) { printw(" (N/A)"); } else { - if (ncv > 0 && (getbkgd(stdscr) & A_COLOR)) { + if (ncv > 0 && stdscr && (getbkgd(stdscr) & A_COLOR)) { static const chtype table[] = { A_STANDOUT, @@ -1675,8 +1675,8 @@ wide_show_attr(int row, int skip, bool arrow, chtype attr, short pair, const cha add_wch(&ch); } } else { - attr_t old_attr; - short old_pair; + attr_t old_attr = 0; + short old_pair = 0; (void) attr_get(&old_attr, &old_pair, 0); (void) attr_set(attr, pair, 0); @@ -3360,6 +3360,7 @@ show_upper_widechars(int first, int repeat, int space, attr_t attr, short pair) * The repeat-count may make text wrap - avoid that. */ getyx(stdscr, y, x); + (void) y; if (x >= col + (COLS / 2) - 2) break; } while (--count > 0); @@ -4269,8 +4270,10 @@ acs_and_scroll(void) neww->next = current ? current->next : 0; neww->last = current; - neww->last->next = neww; - neww->next->last = neww; + if (neww->last != 0) + neww->last->next = neww; + if (neww->next != 0) + neww->next->last = neww; neww->wind = getwin(fp);