Android-x86
Fork
捐款

  • R/O
  • HTTP
  • SSH
  • HTTPS

external-libncurses: 提交

external/libncurses


Commit MetaInfo

修訂56a81c7e79f73d397cc8074401d039f59c34cad5 (tree)
時間2021-05-09 09:34:51
作者Thomas E. Dickey <dickey@invi...>
CommiterThomas E. Dickey

Log Message

ncurses 6.2 - patch 20210508

+ modify tputs' error check to allow it to be used without first

calling tgetent or setupterm, noting that terminfo initialization
is requires for supporting the terminfo delay feature (report by
Sebastiano Vigna).

+ fix several warnings from clang --analyze
+ add null-pointer check in comp_parse.c, when a "use=" clause refers

to a nonexisting terminal description (report/patch by Miroslav
Lichvar, cf: 20210227).

Change Summary

差異

--- a/NEWS
+++ b/NEWS
@@ -26,7 +26,7 @@
2626 -- sale, use or other dealings in this Software without prior written --
2727 -- authorization. --
2828 -------------------------------------------------------------------------------
29--- $Id: NEWS,v 1.3660 2021/05/01 21:55:29 tom Exp $
29+-- $Id: NEWS,v 1.3662 2021/05/08 23:37:13 tom Exp $
3030 -------------------------------------------------------------------------------
3131
3232 This is a log of changes that ncurses has gone through since Zeyd started
@@ -46,6 +46,16 @@ See the AUTHORS file for the corresponding full names.
4646 Changes through 1.9.9e did not credit all contributions;
4747 it is not possible to add this information.
4848
49+20210508
50+ + modify tputs' error check to allow it to be used without first
51+ calling tgetent or setupterm, noting that terminfo initialization
52+ is requires for supporting the terminfo delay feature (report by
53+ Sebastiano Vigna).
54+ + fix several warnings from clang --analyze
55+ + add null-pointer check in comp_parse.c, when a "use=" clause refers
56+ to a nonexisting terminal description (report/patch by Miroslav
57+ Lichvar, cf: 20210227).
58+
4959 20210501
5060 + add a special case in the configure script to work around one of the
5161 build-time breakages reported for OpenBSD 6 here:
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
1-5:0:10 6.2 20210501
1+5:0:10 6.2 20210508
--- a/dist.mk
+++ b/dist.mk
@@ -26,7 +26,7 @@
2626 # use or other dealings in this Software without prior written #
2727 # authorization. #
2828 ##############################################################################
29-# $Id: dist.mk,v 1.1413 2021/05/01 09:40:30 tom Exp $
29+# $Id: dist.mk,v 1.1414 2021/05/08 13:20:24 tom Exp $
3030 # Makefile for creating ncurses distributions.
3131 #
3232 # This only needs to be used directly as a makefile by developers, but
@@ -38,7 +38,7 @@ SHELL = /bin/sh
3838 # These define the major/minor/patch versions of ncurses.
3939 NCURSES_MAJOR = 6
4040 NCURSES_MINOR = 2
41-NCURSES_PATCH = 20210501
41+NCURSES_PATCH = 20210508
4242
4343 # We don't append the patch to the version, since this only applies to releases
4444 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
--- a/menu/m_post.c
+++ b/menu/m_post.c
@@ -38,7 +38,7 @@
3838
3939 #include "menu.priv.h"
4040
41-MODULE_ID("$Id: m_post.c,v 1.35 2021/03/27 23:46:29 tom Exp $")
41+MODULE_ID("$Id: m_post.c,v 1.36 2021/05/08 20:20:01 tom Exp $")
4242
4343 /*---------------------------------------------------------------------------
4444 | Facility : libnmenu
@@ -215,45 +215,48 @@ _nc_Draw_Menu(const MENU *menu)
215215
216216 lastvert = (menu->opt & O_NONCYCLIC) ? (ITEM *)0 : item;
217217
218- do
218+ if (item != NULL)
219219 {
220- ITEM *lasthor;
221-
222- wmove(menu->win, y, 0);
223-
224- hitem = item;
225- lasthor = (menu->opt & O_NONCYCLIC) ? (ITEM *)0 : hitem;
226-
227220 do
228221 {
229- _nc_Post_Item(menu, hitem);
222+ ITEM *lasthor;
230223
231- wattron(menu->win, (int)menu->back);
232- if (((hitem = hitem->right) != lasthor) && hitem)
224+ wmove(menu->win, y, 0);
225+
226+ hitem = item;
227+ lasthor = (menu->opt & O_NONCYCLIC) ? (ITEM *)0 : hitem;
228+
229+ do
233230 {
234- int i, j, cy, cx;
235- chtype ch = ' ';
231+ _nc_Post_Item(menu, hitem);
236232
237- getyx(menu->win, cy, cx);
238- for (j = 0; j < menu->spc_rows; j++)
233+ wattron(menu->win, (int)menu->back);
234+ if (((hitem = hitem->right) != lasthor) && hitem)
239235 {
240- wmove(menu->win, cy + j, cx);
241- for (i = 0; i < menu->spc_cols; i++)
236+ int i, j, cy, cx;
237+ chtype ch = ' ';
238+
239+ getyx(menu->win, cy, cx);
240+ for (j = 0; j < menu->spc_rows; j++)
242241 {
243- waddch(menu->win, ch);
242+ wmove(menu->win, cy + j, cx);
243+ for (i = 0; i < menu->spc_cols; i++)
244+ {
245+ waddch(menu->win, ch);
246+ }
244247 }
248+ wmove(menu->win, cy, cx + menu->spc_cols);
245249 }
246- wmove(menu->win, cy, cx + menu->spc_cols);
247250 }
248- }
249- while (hitem && (hitem != lasthor));
250- wattroff(menu->win, (int)menu->back);
251+ while (hitem && (hitem != lasthor));
252+ wattroff(menu->win, (int)menu->back);
251253
252- item = item->down;
253- y += menu->spc_rows;
254+ item = item->down;
255+ y += menu->spc_rows;
254256
257+ }
258+ while (item && (item != lastvert));
255259 }
256- while (item && (item != lastvert));
257260 }
258261
259262 /*---------------------------------------------------------------------------
--- a/ncurses/base/lib_bkgd.c
+++ b/ncurses/base/lib_bkgd.c
@@ -37,7 +37,7 @@
3737
3838 #include <curses.priv.h>
3939
40-MODULE_ID("$Id: lib_bkgd.c,v 1.62 2021/02/13 20:06:54 tom Exp $")
40+MODULE_ID("$Id: lib_bkgd.c,v 1.63 2021/05/08 14:58:12 tom Exp $")
4141
4242 static const NCURSES_CH_T blank = NewChar(BLANK_TEXT);
4343
@@ -64,7 +64,7 @@ wbkgrndset(WINDOW *win, const ARG_CH_T ch)
6464 {
6565 int pair;
6666
67- if ((pair = GetPair(win->_nc_bkgd)) != 0)
67+ if (GetPair(win->_nc_bkgd) != 0)
6868 SET_WINDOW_PAIR(win, 0);
6969 if ((pair = GetPair(CHDEREF(ch))) != 0)
7070 SET_WINDOW_PAIR(win, pair);
--- a/ncurses/base/lib_color.c
+++ b/ncurses/base/lib_color.c
@@ -49,7 +49,7 @@
4949 #define CUR SP_TERMTYPE
5050 #endif
5151
52-MODULE_ID("$Id: lib_color.c,v 1.146 2021/02/14 00:17:09 tom Exp $")
52+MODULE_ID("$Id: lib_color.c,v 1.147 2021/05/08 15:11:48 tom Exp $")
5353
5454 #ifdef USE_TERM_DRIVER
5555 #define CanChange InfoOf(SP_PARM).canchange
@@ -266,7 +266,7 @@ init_direct_colors(NCURSES_SP_DCL0)
266266 ;
267267 }
268268
269- if ((n = tigetflag(name)) > 0) {
269+ if (tigetflag(name) > 0) {
270270 n = (width + 2) / 3;
271271 result->bits.red = UChar(n);
272272 result->bits.green = UChar(n);
@@ -840,52 +840,57 @@ _nc_color_content(SCREEN *sp, int color, int *r, int *g, int *b)
840840 (void *) g,
841841 (void *) b));
842842
843- if (sp == 0)
844- returnCode(result);
845-
846- maxcolors = MaxColors;
843+ if (sp != 0) {
844+ maxcolors = MaxColors;
847845
848- if (color < 0 || !OkColorHi(color) || !sp->_coloron) {
849- result = ERR;
850- } else {
851- int c_r, c_g, c_b;
846+ if (color >= 0 && OkColorHi(color) && sp->_coloron) {
847+ int c_r, c_g, c_b;
852848
853- if (sp->_direct_color.value) {
854- rgb_bits_t *work = &(sp->_direct_color);
849+ if (sp->_direct_color.value) {
850+ rgb_bits_t *work = &(sp->_direct_color);
855851
856852 #define max_direct_color(name) ((1 << work->bits.name) - 1)
857853 #define value_direct_color(max) (1000 * ((color >> bitoff) & max)) / max
858854
859- int max_r = max_direct_color(red);
860- int max_g = max_direct_color(green);
861- int max_b = max_direct_color(blue);
855+ int max_r = max_direct_color(red);
856+ int max_g = max_direct_color(green);
857+ int max_b = max_direct_color(blue);
862858
863- int bitoff = 0;
859+ int bitoff = 0;
864860
865- c_b = value_direct_color(max_b);
866- bitoff += work->bits.blue;
861+ c_b = value_direct_color(max_b);
862+ bitoff += work->bits.blue;
867863
868- c_g = value_direct_color(max_g);
869- bitoff += work->bits.green;
864+ c_g = value_direct_color(max_g);
865+ bitoff += work->bits.green;
870866
871- c_r = value_direct_color(max_r);
867+ c_r = value_direct_color(max_r);
872868
873- } else {
874- c_r = sp->_color_table[color].red;
875- c_g = sp->_color_table[color].green;
876- c_b = sp->_color_table[color].blue;
877- }
869+ } else {
870+ c_r = sp->_color_table[color].red;
871+ c_g = sp->_color_table[color].green;
872+ c_b = sp->_color_table[color].blue;
873+ }
874+
875+ if (r)
876+ *r = c_r;
877+ if (g)
878+ *g = c_g;
879+ if (b)
880+ *b = c_b;
878881
882+ TR(TRACE_ATTRS, ("...color_content(%d,%d,%d,%d)",
883+ color, c_r, c_g, c_b));
884+ result = OK;
885+ }
886+ }
887+ if (result != OK) {
879888 if (r)
880- *r = c_r;
889+ *r = 0;
881890 if (g)
882- *g = c_g;
891+ *g = 0;
883892 if (b)
884- *b = c_b;
885-
886- TR(TRACE_ATTRS, ("...color_content(%d,%d,%d,%d)",
887- color, c_r, c_g, c_b));
888- result = OK;
893+ *b = 0;
889894 }
890895 returnCode(result);
891896 }
--- a/ncurses/base/lib_set_term.c
+++ b/ncurses/base/lib_set_term.c
@@ -54,7 +54,7 @@
5454 #undef CUR
5555 #define CUR SP_TERMTYPE
5656
57-MODULE_ID("$Id: lib_set_term.c,v 1.177 2021/04/17 15:04:41 tom Exp $")
57+MODULE_ID("$Id: lib_set_term.c,v 1.179 2021/05/08 21:48:34 tom Exp $")
5858
5959 #ifdef USE_TERM_DRIVER
6060 #define MaxColors InfoOf(sp).maxcolors
@@ -417,7 +417,6 @@ NCURSES_SP_NAME(_nc_setupscreen) (
417417 fflush(output);
418418 _setmode(fileno(output), _O_BINARY);
419419 #endif
420- NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_ARGx output, TRUE);
421420 sp->_lines = (NCURSES_SIZE_T) slines;
422421 sp->_lines_avail = (NCURSES_SIZE_T) slines;
423422 sp->_columns = (NCURSES_SIZE_T) scolumns;
@@ -500,7 +499,7 @@ NCURSES_SP_NAME(_nc_setupscreen) (
500499 p = extract_fgbg(p, &(sp->_default_fg));
501500 p = extract_fgbg(p, &(sp->_default_bg));
502501 if (*p) /* assume rxvt was compiled with xpm support */
503- p = extract_fgbg(p, &(sp->_default_bg));
502+ extract_fgbg(p, &(sp->_default_bg));
504503 TR(TRACE_CHARPUT | TRACE_MOVE, ("decoded fg=%d, bg=%d",
505504 sp->_default_fg, sp->_default_bg));
506505 if (sp->_default_fg >= MaxColors) {
@@ -697,6 +696,9 @@ NCURSES_SP_NAME(_nc_setupscreen) (
697696 formats (4-4 or 3-2-3) for which there may be some hardware
698697 support. */
699698 if (rop->hook == _nc_slk_initialize) {
699+ if (!TerminalOf(sp)) {
700+ continue;
701+ }
700702 if (!(NumLabels <= 0 || !SLK_STDFMT(slk_format))) {
701703 continue;
702704 }
--- a/ncurses/base/new_pair.c
+++ b/ncurses/base/new_pair.c
@@ -61,7 +61,7 @@
6161
6262 #endif
6363
64-MODULE_ID("$Id: new_pair.c,v 1.21 2021/02/14 00:17:09 tom Exp $")
64+MODULE_ID("$Id: new_pair.c,v 1.22 2021/05/08 15:26:34 tom Exp $")
6565
6666 #if NCURSES_EXT_COLORS
6767
@@ -297,7 +297,7 @@ NCURSES_SP_NAME(alloc_pair) (NCURSES_SP_DCLx int fg, int bg)
297297 found = TRUE;
298298 }
299299 }
300- if (!found) {
300+ if (!found && SP_PARM->_color_pairs != NULL) {
301301 for (pair = 1; pair <= hint; pair++) {
302302 if (SP_PARM->_color_pairs[pair].mode == cpFREE) {
303303 T(("found gap %d", pair));
--- a/ncurses/tinfo/alloc_entry.c
+++ b/ncurses/tinfo/alloc_entry.c
@@ -1,5 +1,5 @@
11 /****************************************************************************
2- * Copyright 2018-2019,2020 Thomas E. Dickey *
2+ * Copyright 2018-2020,2021 Thomas E. Dickey *
33 * Copyright 1998-2013,2017 Free Software Foundation, Inc. *
44 * *
55 * Permission is hereby granted, free of charge, to any person obtaining a *
@@ -48,7 +48,7 @@
4848
4949 #include <tic.h>
5050
51-MODULE_ID("$Id: alloc_entry.c,v 1.64 2020/02/02 23:34:34 tom Exp $")
51+MODULE_ID("$Id: alloc_entry.c,v 1.65 2021/05/04 23:15:34 tom Exp $")
5252
5353 #define ABSENT_OFFSET -1
5454 #define CANCELLED_OFFSET -2
@@ -242,7 +242,7 @@ _nc_merge_entry(ENTRY * const target, ENTRY * const source)
242242 _nc_align_termtype(to, from);
243243 #endif
244244 for_each_boolean(i, from) {
245- if (to->Booleans[i] != (char) CANCELLED_BOOLEAN) {
245+ if (to->Booleans[i] != (NCURSES_SBOOL) CANCELLED_BOOLEAN) {
246246 int mergebool = from->Booleans[i];
247247
248248 if (mergebool == CANCELLED_BOOLEAN)
--- a/ncurses/tinfo/comp_parse.c
+++ b/ncurses/tinfo/comp_parse.c
@@ -48,7 +48,7 @@
4848
4949 #include <tic.h>
5050
51-MODULE_ID("$Id: comp_parse.c,v 1.112 2021/02/27 21:01:21 tom Exp $")
51+MODULE_ID("$Id: comp_parse.c,v 1.113 2021/05/08 15:03:42 tom Exp $")
5252
5353 static void sanity_check2(TERMTYPE2 *, bool);
5454 NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2;
@@ -457,8 +457,9 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
457457
458458 /* verify that there are no earlier uses */
459459 for (j = 0; j < i; ++j) {
460- if (!strcmp(qp->uses[j].link->tterm.term_names,
461- rp->tterm.term_names)) {
460+ if (qp->uses[j].link != NULL
461+ && !strcmp(qp->uses[j].link->tterm.term_names,
462+ rp->tterm.term_names)) {
462463 _nc_warning("duplicate use=%s", lookfor);
463464 break;
464465 }
@@ -487,8 +488,9 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
487488
488489 /* verify that there are no earlier uses */
489490 for (j = 0; j < i; ++j) {
490- if (!strcmp(qp->uses[j].link->tterm.term_names,
491- rp->tterm.term_names)) {
491+ if (qp->uses[j].link != NULL
492+ && !strcmp(qp->uses[j].link->tterm.term_names,
493+ rp->tterm.term_names)) {
492494 _nc_warning("duplicate use=%s", lookfor);
493495 break;
494496 }
--- a/ncurses/tinfo/lib_tputs.c
+++ b/ncurses/tinfo/lib_tputs.c
@@ -52,7 +52,7 @@
5252 #include <termcap.h> /* ospeed */
5353 #include <tic.h>
5454
55-MODULE_ID("$Id: lib_tputs.c,v 1.107 2021/04/03 18:45:53 tom Exp $")
55+MODULE_ID("$Id: lib_tputs.c,v 1.108 2021/05/08 23:27:40 tom Exp $")
5656
5757 NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */
5858 NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */
@@ -276,8 +276,8 @@ NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx
276276 NCURSES_SP_OUTC outc)
277277 {
278278 NCURSES_SP_OUTC my_outch = GetOutCh();
279- bool always_delay;
280- bool normal_delay;
279+ bool always_delay = FALSE;
280+ bool normal_delay = FALSE;
281281 int number;
282282 #if BSD_TPUTS
283283 int trailpad;
@@ -305,32 +305,30 @@ NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx
305305 }
306306 #endif /* TRACE */
307307
308- if (SP_PARM != 0 && !HasTInfoTerminal(SP_PARM))
309- return ERR;
310-
311308 if (!VALID_STRING(string))
312309 return ERR;
313310
314- if (
311+ if (SP_PARM != 0 && HasTInfoTerminal(SP_PARM)) {
312+ if (
315313 #if NCURSES_SP_FUNCS
316- (SP_PARM != 0 && SP_PARM->_term == 0)
314+ (SP_PARM != 0 && SP_PARM->_term == 0)
317315 #else
318- cur_term == 0
316+ cur_term == 0
319317 #endif
320- ) {
321- always_delay = FALSE;
322- normal_delay = TRUE;
323- } else {
324- always_delay = (string == bell) || (string == flash_screen);
325- normal_delay =
326- !xon_xoff
327- && padding_baud_rate
318+ ) {
319+ always_delay = FALSE;
320+ normal_delay = TRUE;
321+ } else {
322+ always_delay = (string == bell) || (string == flash_screen);
323+ normal_delay =
324+ !xon_xoff
325+ && padding_baud_rate
328326 #if NCURSES_NO_PADDING
329- && !GetNoPadding(SP_PARM)
327+ && !GetNoPadding(SP_PARM)
330328 #endif
331- && (_nc_baudrate(ospeed) >= padding_baud_rate);
329+ && (_nc_baudrate(ospeed) >= padding_baud_rate);
330+ }
332331 }
333-
334332 #if BSD_TPUTS
335333 /*
336334 * This ugly kluge deals with the fact that some ancient BSD programs
--- a/package/debian-mingw/changelog
+++ b/package/debian-mingw/changelog
@@ -1,8 +1,8 @@
1-ncurses6 (6.2+20210501) unstable; urgency=low
1+ncurses6 (6.2+20210508) unstable; urgency=low
22
33 * latest weekly patch
44
5- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 01 May 2021 05:40:30 -0400
5+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 08 May 2021 09:20:24 -0400
66
77 ncurses6 (5.9-20131005) unstable; urgency=low
88
--- a/package/debian-mingw64/changelog
+++ b/package/debian-mingw64/changelog
@@ -1,8 +1,8 @@
1-ncurses6 (6.2+20210501) unstable; urgency=low
1+ncurses6 (6.2+20210508) unstable; urgency=low
22
33 * latest weekly patch
44
5- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 01 May 2021 05:40:30 -0400
5+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 08 May 2021 09:20:24 -0400
66
77 ncurses6 (5.9-20131005) unstable; urgency=low
88
--- a/package/debian/changelog
+++ b/package/debian/changelog
@@ -1,8 +1,8 @@
1-ncurses6 (6.2+20210501) unstable; urgency=low
1+ncurses6 (6.2+20210508) unstable; urgency=low
22
33 * latest weekly patch
44
5- -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 01 May 2021 05:40:30 -0400
5+ -- Thomas E. Dickey <dickey@invisible-island.net> Sat, 08 May 2021 09:20:24 -0400
66
77 ncurses6 (5.9-20120608) unstable; urgency=low
88
--- a/package/mingw-ncurses.nsi
+++ b/package/mingw-ncurses.nsi
@@ -1,4 +1,4 @@
1-; $Id: mingw-ncurses.nsi,v 1.456 2021/05/01 09:40:30 tom Exp $
1+; $Id: mingw-ncurses.nsi,v 1.457 2021/05/08 13:20:24 tom Exp $
22
33 ; TODO add examples
44 ; TODO bump ABI to 6
@@ -10,7 +10,7 @@
1010 !define VERSION_MAJOR "6"
1111 !define VERSION_MINOR "2"
1212 !define VERSION_YYYY "2021"
13-!define VERSION_MMDD "0501"
13+!define VERSION_MMDD "0508"
1414 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
1515
1616 !define MY_ABI "5"
--- a/package/mingw-ncurses.spec
+++ b/package/mingw-ncurses.spec
@@ -3,7 +3,7 @@
33 Summary: shared libraries for terminal handling
44 Name: mingw32-ncurses6
55 Version: 6.2
6-Release: 20210501
6+Release: 20210508
77 License: X11
88 Group: Development/Libraries
99 Source: ncurses-%{version}-%{release}.tgz
--- a/package/ncurses.spec
+++ b/package/ncurses.spec
@@ -1,7 +1,7 @@
11 Summary: shared libraries for terminal handling
22 Name: ncurses6
33 Version: 6.2
4-Release: 20210501
4+Release: 20210508
55 License: X11
66 Group: Development/Libraries
77 Source: ncurses-%{version}-%{release}.tgz
--- a/package/ncursest.spec
+++ b/package/ncursest.spec
@@ -1,7 +1,7 @@
11 Summary: Curses library with POSIX thread support.
22 Name: ncursest6
33 Version: 6.2
4-Release: 20210501
4+Release: 20210508
55 License: X11
66 Group: Development/Libraries
77 Source: ncurses-%{version}-%{release}.tgz
--- a/test/demo_menus.c
+++ b/test/demo_menus.c
@@ -27,7 +27,7 @@
2727 * authorization. *
2828 ****************************************************************************/
2929 /*
30- * $Id: demo_menus.c,v 1.72 2021/03/20 16:05:49 tom Exp $
30+ * $Id: demo_menus.c,v 1.73 2021/05/08 19:41:08 tom Exp $
3131 *
3232 * Demonstrate a variety of functions from the menu library.
3333 * Thomas Dickey - 2005/4/9
@@ -565,7 +565,7 @@ tracetrace(unsigned tlevel)
565565 }
566566 _nc_SPRINTF(buf, _nc_SLIMIT(need) "0x%02x = {", tlevel);
567567 if (tlevel == 0) {
568- _nc_STRCAT(buf, t_tbl[0].name, need);
568+ _nc_STRCAT(buf, t_tbl[0].name ? t_tbl[0].name : "", need);
569569 _nc_STRCAT(buf, ", ", need);
570570 } else {
571571 for (n = 1; t_tbl[n].name != 0; n++)
--- a/test/hanoi.c
+++ b/test/hanoi.c
@@ -1,5 +1,5 @@
11 /****************************************************************************
2- * Copyright 2019,2020 Thomas E. Dickey *
2+ * Copyright 2019-2020,2021 Thomas E. Dickey *
33 * Copyright 1998-2014,2017 Free Software Foundation, Inc. *
44 * *
55 * Permission is hereby granted, free of charge, to any person obtaining a *
@@ -42,7 +42,7 @@
4242 *
4343 * Date: 05.Nov.90
4444 *
45- * $Id: hanoi.c,v 1.41 2020/02/02 23:34:34 tom Exp $
45+ * $Id: hanoi.c,v 1.42 2021/05/08 20:44:44 tom Exp $
4646 */
4747
4848 #include <test.priv.h>
@@ -283,7 +283,7 @@ main(int argc, char **argv)
283283 }
284284 setlocale(LC_ALL, "");
285285
286- switch (ch = (argc - optind)) {
286+ switch (argc - optind) {
287287 case 2:
288288 if (strcmp(argv[optind + 1], "a")) {
289289 usage();
--- a/test/knight.c
+++ b/test/knight.c
@@ -34,7 +34,7 @@
3434 * Eric S. Raymond <esr@snark.thyrsus.com> July 22 1995. Mouse support
3535 * added September 20th 1995.
3636 *
37- * $Id: knight.c,v 1.48 2021/04/25 00:10:43 tom Exp $
37+ * $Id: knight.c,v 1.49 2021/05/08 19:32:15 tom Exp $
3838 */
3939
4040 #include <test.priv.h>
@@ -621,10 +621,10 @@ play(void)
621621
622622 for (i = 0; i < ylimit; i++) {
623623 for (j = 0; j < xlimit; j++) {
624- squares[i][j] = FALSE;
625624 unmarkcell(i, j);
626625 }
627626 }
627+ memset(squares, 0, sizeof(squares));
628628 memset(history, 0, sizeof(history));
629629 history[0].y = history[0].x = -1;
630630 history[1].y = history[1].x = -1;
--- a/test/ncurses.c
+++ b/test/ncurses.c
@@ -41,7 +41,7 @@ AUTHOR
4141 Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
4242 Thomas E. Dickey (beginning revision 1.27 in 1996).
4343
44-$Id: ncurses.c,v 1.524 2021/03/20 16:11:50 tom Exp $
44+$Id: ncurses.c,v 1.525 2021/05/08 19:44:31 tom Exp $
4545
4646 ***************************************************************************/
4747
@@ -5531,7 +5531,7 @@ panner_legend(int line)
55315531 "Number repeats. Toggle legend:? filler:a timer:t scrollmark:s."
55325532 };
55335533 int n = ((int) SIZEOF(legend) - (LINES - line));
5534- if (n >= 0) {
5534+ if (n >= 0 && n < (int) SIZEOF(legend)) {
55355535 if (move(line, 0) != ERR) {
55365536 if (show_panner_legend)
55375537 printw("%s", legend[n]);
@@ -6232,7 +6232,7 @@ tracetrace(unsigned tlevel)
62326232 }
62336233 _nc_SPRINTF(buf, _nc_SLIMIT(need) "0x%02x = {", tlevel);
62346234 if (tlevel == 0) {
6235- _nc_STRCAT(buf, t_tbl[0].name, need);
6235+ _nc_STRCAT(buf, t_tbl[0].name ? t_tbl[0].name : "", need);
62366236 _nc_STRCAT(buf, ", ", need);
62376237 } else {
62386238 for (n = 1; t_tbl[n].name != 0; n++)
--- a/test/picsmap.c
+++ b/test/picsmap.c
@@ -27,7 +27,7 @@
2727 * authorization. *
2828 ****************************************************************************/
2929 /*
30- * $Id: picsmap.c,v 1.138 2021/05/01 20:38:40 tom Exp $
30+ * $Id: picsmap.c,v 1.139 2021/05/08 15:56:05 tom Exp $
3131 *
3232 * Author: Thomas E. Dickey
3333 *
@@ -604,7 +604,6 @@ read_palette(const char *filename)
604604 continue;
605605 }
606606 }
607- s += strlen(s);
608607
609608 if (tries & 2) {
610609 int len = (int) strlen(filename);
--- a/test/test_add_wchstr.c
+++ b/test/test_add_wchstr.c
@@ -27,7 +27,7 @@
2727 * authorization. *
2828 ****************************************************************************/
2929 /*
30- * $Id: test_add_wchstr.c,v 1.28 2021/03/27 23:41:34 tom Exp $
30+ * $Id: test_add_wchstr.c,v 1.29 2021/05/08 20:04:10 tom Exp $
3131 *
3232 * Demonstrate the waddwchstr() and wadd_wch functions.
3333 * Thomas Dickey - 2009/9/12
@@ -133,10 +133,10 @@ ChWLen(const wchar_t *source)
133133 size_t adjust = 0;
134134 size_t n;
135135
136- for (n = 0; n < result; ++n) {
136+ for (n = 0; source[n] != 0; ++n) {
137137 const char *s;
138138
139- if (source[n] < 256 && (s = unctrl((chtype) source[n])) != 0) {
139+ if ((source[n] < 256) && (s = unctrl((chtype) source[n])) != 0) {
140140 adjust += (strlen(s) - 1);
141141 }
142142 }
--- a/test/view.c
+++ b/test/view.c
@@ -52,7 +52,7 @@
5252 * scroll operation worked, and the refresh() code only had to do a
5353 * partial repaint.
5454 *
55- * $Id: view.c,v 1.140 2021/03/27 22:42:22 tom Exp $
55+ * $Id: view.c,v 1.141 2021/05/08 15:57:04 tom Exp $
5656 */
5757
5858 #include <test.priv.h>
@@ -78,9 +78,7 @@ static int num_lines;
7878 static bool n_option = FALSE;
7979 #endif
8080
81-static GCC_NORETURN void usage(void);
82-
83-static void
81+static GCC_NORETURN void
8482 failed(const char *msg)
8583 {
8684 endwin();
@@ -368,7 +366,7 @@ read_file(const char *filename)
368366 free(my_blob);
369367 }
370368
371-static void
369+static GCC_NORETURN void
372370 usage(void)
373371 {
374372 static const char *msg[] =
Show on old repository browser