X-Git-Url: https://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=test%2Fncurses.c;h=fd1dcd3b35fe8f555be5b832e629c880074a8cbf;hb=c24295f70ba90ce58d7fd76c0e8d852ab66f41bc;hp=37693ac4e6c07c19b2b507a0c2239a0848f2d125;hpb=c2650100f80134924eda8f22cd7cc1d1d919ee3d;p=ncurses.git diff --git a/test/ncurses.c b/test/ncurses.c index 37693ac4..fd1dcd3b 100644 --- a/test/ncurses.c +++ b/test/ncurses.c @@ -41,7 +41,7 @@ AUTHOR Author: Eric S. Raymond 1993 Thomas E. Dickey (beginning revision 1.27 in 1996). -$Id: ncurses.c,v 1.524 2021/03/20 16:11:50 tom Exp $ +$Id: ncurses.c,v 1.526 2021/05/22 19:45:57 tom Exp $ ***************************************************************************/ @@ -855,7 +855,7 @@ wgetch_test(unsigned level, WINDOW *win, int delay) setup_getch(win, flags); wgetch_help(win, flags); } else if (c == 'g') { - waddstr(win, "getstr test: "); + waddstr(win, "wgetnstr test: "); echo(); c = wgetnstr(win, buf, sizeof(buf) - 1); noecho(); @@ -1113,7 +1113,7 @@ wget_wch_test(unsigned level, WINDOW *win, int delay) setup_getch(win, flags); wgetch_help(win, flags); } else if (c == 'g') { - waddstr(win, "getstr test: "); + waddstr(win, "wgetn_str test: "); echo(); code = wgetn_wstr(win, wint_buf, BUFSIZ - 1); noecho(); @@ -5531,7 +5531,7 @@ panner_legend(int line) "Number repeats. Toggle legend:? filler:a timer:t scrollmark:s." }; int n = ((int) SIZEOF(legend) - (LINES - line)); - if (n >= 0) { + if (n >= 0 && n < (int) SIZEOF(legend)) { if (move(line, 0) != ERR) { if (show_panner_legend) printw("%s", legend[n]); @@ -6232,7 +6232,7 @@ tracetrace(unsigned tlevel) } _nc_SPRINTF(buf, _nc_SLIMIT(need) "0x%02x = {", tlevel); if (tlevel == 0) { - _nc_STRCAT(buf, t_tbl[0].name, need); + _nc_STRCAT(buf, t_tbl[0].name ? t_tbl[0].name : "", need); _nc_STRCAT(buf, ", ", need); } else { for (n = 1; t_tbl[n].name != 0; n++)