]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.2 - patch 20210508
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 9 May 2021 00:34:51 +0000 (00:34 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 9 May 2021 00:34:51 +0000 (00:34 +0000)
+ 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).

25 files changed:
NEWS
VERSION
dist.mk
menu/m_post.c
ncurses/base/lib_bkgd.c
ncurses/base/lib_color.c
ncurses/base/lib_set_term.c
ncurses/base/new_pair.c
ncurses/tinfo/alloc_entry.c
ncurses/tinfo/comp_parse.c
ncurses/tinfo/lib_tputs.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
package/ncursest.spec
test/demo_menus.c
test/hanoi.c
test/knight.c
test/ncurses.c
test/picsmap.c
test/test_add_wchstr.c
test/view.c

diff --git a/NEWS b/NEWS
index 4948668c7535424526b17fa93f9d4a5f3f2ed03b..16c3eabc725841abf49b8dfbf5503b2db29b73f8 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,7 +26,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3660 2021/05/01 21:55:29 tom Exp $
+-- $Id: NEWS,v 1.3662 2021/05/08 23:37:13 tom Exp $
 -------------------------------------------------------------------------------
 
 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.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+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).
+
 20210501
        + add a special case in the configure script to work around one of the
          build-time breakages reported for OpenBSD 6 here:
diff --git a/VERSION b/VERSION
index 68ca8693acbea6adfaa67aa822fabee559949164..168b7e9d4a66562f53c29f0c48f9577f1aab5dfb 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.2     20210501
+5:0:10 6.2     20210508
diff --git a/dist.mk b/dist.mk
index a70125d449f93c2af38f14e43d6f002a93197cd6..372897a356e8cc4f11349856e50cdbcaab72ba52 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -26,7 +26,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.1413 2021/05/01 09:40:30 tom Exp $
+# $Id: dist.mk,v 1.1414 2021/05/08 13:20:24 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -38,7 +38,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 6
 NCURSES_MINOR = 2
-NCURSES_PATCH = 20210501
+NCURSES_PATCH = 20210508
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index b4b1bc14eb77fc32cb3c72425dd3b116b146333c..1dbd6b807bde8a673da7a2581e5f9f161a9db08c 100644 (file)
@@ -38,7 +38,7 @@
 
 #include "menu.priv.h"
 
-MODULE_ID("$Id: m_post.c,v 1.35 2021/03/27 23:46:29 tom Exp $")
+MODULE_ID("$Id: m_post.c,v 1.36 2021/05/08 20:20:01 tom Exp $")
 
 /*---------------------------------------------------------------------------
 |   Facility      :  libnmenu
@@ -215,45 +215,48 @@ _nc_Draw_Menu(const MENU *menu)
 
   lastvert = (menu->opt & O_NONCYCLIC) ? (ITEM *)0 : item;
 
-  do
+  if (item != NULL)
     {
-      ITEM *lasthor;
-
-      wmove(menu->win, y, 0);
-
-      hitem = item;
-      lasthor = (menu->opt & O_NONCYCLIC) ? (ITEM *)0 : hitem;
-
       do
        {
-         _nc_Post_Item(menu, hitem);
+         ITEM *lasthor;
 
-         wattron(menu->win, (int)menu->back);
-         if (((hitem = hitem->right) != lasthor) && hitem)
+         wmove(menu->win, y, 0);
+
+         hitem = item;
+         lasthor = (menu->opt & O_NONCYCLIC) ? (ITEM *)0 : hitem;
+
+         do
            {
-             int i, j, cy, cx;
-             chtype ch = ' ';
+             _nc_Post_Item(menu, hitem);
 
-             getyx(menu->win, cy, cx);
-             for (j = 0; j < menu->spc_rows; j++)
+             wattron(menu->win, (int)menu->back);
+             if (((hitem = hitem->right) != lasthor) && hitem)
                {
-                 wmove(menu->win, cy + j, cx);
-                 for (i = 0; i < menu->spc_cols; i++)
+                 int i, j, cy, cx;
+                 chtype ch = ' ';
+
+                 getyx(menu->win, cy, cx);
+                 for (j = 0; j < menu->spc_rows; j++)
                    {
-                     waddch(menu->win, ch);
+                     wmove(menu->win, cy + j, cx);
+                     for (i = 0; i < menu->spc_cols; i++)
+                       {
+                         waddch(menu->win, ch);
+                       }
                    }
+                 wmove(menu->win, cy, cx + menu->spc_cols);
                }
-             wmove(menu->win, cy, cx + menu->spc_cols);
            }
-       }
-      while (hitem && (hitem != lasthor));
-      wattroff(menu->win, (int)menu->back);
+         while (hitem && (hitem != lasthor));
+         wattroff(menu->win, (int)menu->back);
 
-      item = item->down;
-      y += menu->spc_rows;
+         item = item->down;
+         y += menu->spc_rows;
 
+       }
+      while (item && (item != lastvert));
     }
-  while (item && (item != lastvert));
 }
 
 /*---------------------------------------------------------------------------
index 23effc7cd141f5a24f944ccf102e67c84a0367c2..4f99080835e80f6cb2d2d0fcdb5b2e375211f509 100644 (file)
@@ -37,7 +37,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_bkgd.c,v 1.62 2021/02/13 20:06:54 tom Exp $")
+MODULE_ID("$Id: lib_bkgd.c,v 1.63 2021/05/08 14:58:12 tom Exp $")
 
 static const NCURSES_CH_T blank = NewChar(BLANK_TEXT);
 
@@ -64,7 +64,7 @@ wbkgrndset(WINDOW *win, const ARG_CH_T ch)
        {
            int pair;
 
-           if ((pair = GetPair(win->_nc_bkgd)) != 0)
+           if (GetPair(win->_nc_bkgd) != 0)
                SET_WINDOW_PAIR(win, 0);
            if ((pair = GetPair(CHDEREF(ch))) != 0)
                SET_WINDOW_PAIR(win, pair);
index 907e9743fcdac924ce62502e3b0890853930472b..e4276784f8fed6d5ffd25510c19ae4fd9cfd7f1c 100644 (file)
@@ -49,7 +49,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_color.c,v 1.146 2021/02/14 00:17:09 tom Exp $")
+MODULE_ID("$Id: lib_color.c,v 1.147 2021/05/08 15:11:48 tom Exp $")
 
 #ifdef USE_TERM_DRIVER
 #define CanChange      InfoOf(SP_PARM).canchange
@@ -266,7 +266,7 @@ init_direct_colors(NCURSES_SP_DCL0)
            ;
        }
 
-       if ((n = tigetflag(name)) > 0) {
+       if (tigetflag(name) > 0) {
            n = (width + 2) / 3;
            result->bits.red = UChar(n);
            result->bits.green = UChar(n);
@@ -840,52 +840,57 @@ _nc_color_content(SCREEN *sp, int color, int *r, int *g, int *b)
        (void *) g,
        (void *) b));
 
-    if (sp == 0)
-       returnCode(result);
-
-    maxcolors = MaxColors;
+    if (sp != 0) {
+       maxcolors = MaxColors;
 
-    if (color < 0 || !OkColorHi(color) || !sp->_coloron) {
-       result = ERR;
-    } else {
-       int c_r, c_g, c_b;
+       if (color >= 0 && OkColorHi(color) && sp->_coloron) {
+           int c_r, c_g, c_b;
 
-       if (sp->_direct_color.value) {
-           rgb_bits_t *work = &(sp->_direct_color);
+           if (sp->_direct_color.value) {
+               rgb_bits_t *work = &(sp->_direct_color);
 
 #define max_direct_color(name) ((1 << work->bits.name) - 1)
 #define value_direct_color(max) (1000 * ((color >> bitoff) & max)) / max
 
-           int max_r = max_direct_color(red);
-           int max_g = max_direct_color(green);
-           int max_b = max_direct_color(blue);
+               int max_r = max_direct_color(red);
+               int max_g = max_direct_color(green);
+               int max_b = max_direct_color(blue);
 
-           int bitoff = 0;
+               int bitoff = 0;
 
-           c_b = value_direct_color(max_b);
-           bitoff += work->bits.blue;
+               c_b = value_direct_color(max_b);
+               bitoff += work->bits.blue;
 
-           c_g = value_direct_color(max_g);
-           bitoff += work->bits.green;
+               c_g = value_direct_color(max_g);
+               bitoff += work->bits.green;
 
-           c_r = value_direct_color(max_r);
+               c_r = value_direct_color(max_r);
 
-       } else {
-           c_r = sp->_color_table[color].red;
-           c_g = sp->_color_table[color].green;
-           c_b = sp->_color_table[color].blue;
-       }
+           } else {
+               c_r = sp->_color_table[color].red;
+               c_g = sp->_color_table[color].green;
+               c_b = sp->_color_table[color].blue;
+           }
+
+           if (r)
+               *r = c_r;
+           if (g)
+               *g = c_g;
+           if (b)
+               *b = c_b;
 
+           TR(TRACE_ATTRS, ("...color_content(%d,%d,%d,%d)",
+                            color, c_r, c_g, c_b));
+           result = OK;
+       }
+    }
+    if (result != OK) {
        if (r)
-           *r = c_r;
+           *r = 0;
        if (g)
-           *g = c_g;
+           *g = 0;
        if (b)
-           *b = c_b;
-
-       TR(TRACE_ATTRS, ("...color_content(%d,%d,%d,%d)",
-                        color, c_r, c_g, c_b));
-       result = OK;
+           *b = 0;
     }
     returnCode(result);
 }
index c2751ec4853ba9559a9e22090125087e88604a77..264fb98ec29d24706ed3b86092d40711823a816f 100644 (file)
@@ -54,7 +54,7 @@
 #undef CUR
 #define CUR SP_TERMTYPE
 
-MODULE_ID("$Id: lib_set_term.c,v 1.177 2021/04/17 15:04:41 tom Exp $")
+MODULE_ID("$Id: lib_set_term.c,v 1.179 2021/05/08 21:48:34 tom Exp $")
 
 #ifdef USE_TERM_DRIVER
 #define MaxColors      InfoOf(sp).maxcolors
@@ -417,7 +417,6 @@ NCURSES_SP_NAME(_nc_setupscreen) (
     fflush(output);
     _setmode(fileno(output), _O_BINARY);
 #endif
-    NCURSES_SP_NAME(_nc_set_buffer) (NCURSES_SP_ARGx output, TRUE);
     sp->_lines = (NCURSES_SIZE_T) slines;
     sp->_lines_avail = (NCURSES_SIZE_T) slines;
     sp->_columns = (NCURSES_SIZE_T) scolumns;
@@ -500,7 +499,7 @@ NCURSES_SP_NAME(_nc_setupscreen) (
        p = extract_fgbg(p, &(sp->_default_fg));
        p = extract_fgbg(p, &(sp->_default_bg));
        if (*p)                 /* assume rxvt was compiled with xpm support */
-           p = extract_fgbg(p, &(sp->_default_bg));
+           extract_fgbg(p, &(sp->_default_bg));
        TR(TRACE_CHARPUT | TRACE_MOVE, ("decoded fg=%d, bg=%d",
                                        sp->_default_fg, sp->_default_bg));
        if (sp->_default_fg >= MaxColors) {
@@ -697,6 +696,9 @@ NCURSES_SP_NAME(_nc_setupscreen) (
               formats (4-4 or 3-2-3) for which there may be some hardware
               support. */
            if (rop->hook == _nc_slk_initialize) {
+               if (!TerminalOf(sp)) {
+                   continue;
+               }
                if (!(NumLabels <= 0 || !SLK_STDFMT(slk_format))) {
                    continue;
                }
index c04f4acbb95d7166f875a76c242fb0834b70da21..33369da4ba04e57bb268e308b81e158b283e94cb 100644 (file)
@@ -61,7 +61,7 @@
 
 #endif
 
-MODULE_ID("$Id: new_pair.c,v 1.21 2021/02/14 00:17:09 tom Exp $")
+MODULE_ID("$Id: new_pair.c,v 1.22 2021/05/08 15:26:34 tom Exp $")
 
 #if NCURSES_EXT_COLORS
 
@@ -297,7 +297,7 @@ NCURSES_SP_NAME(alloc_pair) (NCURSES_SP_DCLx int fg, int bg)
                    found = TRUE;
                }
            }
-           if (!found) {
+           if (!found && SP_PARM->_color_pairs != NULL) {
                for (pair = 1; pair <= hint; pair++) {
                    if (SP_PARM->_color_pairs[pair].mode == cpFREE) {
                        T(("found gap %d", pair));
index 4bf7d6c8a082248e4fd59eb6169f39808f1d7bb7..de2801243c582e6366feb44c762ea9f36a509dbe 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 1998-2013,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -48,7 +48,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: alloc_entry.c,v 1.64 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: alloc_entry.c,v 1.65 2021/05/04 23:15:34 tom Exp $")
 
 #define ABSENT_OFFSET    -1
 #define CANCELLED_OFFSET -2
@@ -242,7 +242,7 @@ _nc_merge_entry(ENTRY * const target, ENTRY * const source)
     _nc_align_termtype(to, from);
 #endif
     for_each_boolean(i, from) {
-       if (to->Booleans[i] != (char) CANCELLED_BOOLEAN) {
+       if (to->Booleans[i] != (NCURSES_SBOOL) CANCELLED_BOOLEAN) {
            int mergebool = from->Booleans[i];
 
            if (mergebool == CANCELLED_BOOLEAN)
index e47625b3dbe1735ff8cd2044bd804d6202ad9a1d..2bc9485342742708c0452ea90076b9a83837a189 100644 (file)
@@ -48,7 +48,7 @@
 
 #include <tic.h>
 
-MODULE_ID("$Id: comp_parse.c,v 1.112 2021/02/27 21:01:21 tom Exp $")
+MODULE_ID("$Id: comp_parse.c,v 1.113 2021/05/08 15:03:42 tom Exp $")
 
 static void sanity_check2(TERMTYPE2 *, bool);
 NCURSES_IMPEXP void (NCURSES_API *_nc_check_termtype2) (TERMTYPE2 *, bool) = sanity_check2;
@@ -457,8 +457,9 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
 
                    /* verify that there are no earlier uses */
                    for (j = 0; j < i; ++j) {
-                       if (!strcmp(qp->uses[j].link->tterm.term_names,
-                                   rp->tterm.term_names)) {
+                       if (qp->uses[j].link != NULL
+                           && !strcmp(qp->uses[j].link->tterm.term_names,
+                                      rp->tterm.term_names)) {
                            _nc_warning("duplicate use=%s", lookfor);
                            break;
                        }
@@ -487,8 +488,9 @@ _nc_resolve_uses2(bool fullresolve, bool literal)
 
                    /* verify that there are no earlier uses */
                    for (j = 0; j < i; ++j) {
-                       if (!strcmp(qp->uses[j].link->tterm.term_names,
-                                   rp->tterm.term_names)) {
+                       if (qp->uses[j].link != NULL
+                           && !strcmp(qp->uses[j].link->tterm.term_names,
+                                      rp->tterm.term_names)) {
                            _nc_warning("duplicate use=%s", lookfor);
                            break;
                        }
index 4b89a19ed9ddd1b97607cef676a921960dd69a06..b9ca41cc10b14ceccf1e8f325e3552fffe8f29cb 100644 (file)
@@ -52,7 +52,7 @@
 #include <termcap.h>           /* ospeed */
 #include <tic.h>
 
-MODULE_ID("$Id: lib_tputs.c,v 1.107 2021/04/03 18:45:53 tom Exp $")
+MODULE_ID("$Id: lib_tputs.c,v 1.108 2021/05/08 23:27:40 tom Exp $")
 
 NCURSES_EXPORT_VAR(char) PC = 0;              /* used by termcap library */
 NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0;        /* used by termcap library */
@@ -276,8 +276,8 @@ NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx
                        NCURSES_SP_OUTC outc)
 {
     NCURSES_SP_OUTC my_outch = GetOutCh();
-    bool always_delay;
-    bool normal_delay;
+    bool always_delay = FALSE;
+    bool normal_delay = FALSE;
     int number;
 #if BSD_TPUTS
     int trailpad;
@@ -305,32 +305,30 @@ NCURSES_SP_NAME(tputs) (NCURSES_SP_DCLx
     }
 #endif /* TRACE */
 
-    if (SP_PARM != 0 && !HasTInfoTerminal(SP_PARM))
-       return ERR;
-
     if (!VALID_STRING(string))
        return ERR;
 
-    if (
+    if (SP_PARM != 0 && HasTInfoTerminal(SP_PARM)) {
+       if (
 #if NCURSES_SP_FUNCS
-          (SP_PARM != 0 && SP_PARM->_term == 0)
+              (SP_PARM != 0 && SP_PARM->_term == 0)
 #else
-          cur_term == 0
+              cur_term == 0
 #endif
-       ) {
-       always_delay = FALSE;
-       normal_delay = TRUE;
-    } else {
-       always_delay = (string == bell) || (string == flash_screen);
-       normal_delay =
-           !xon_xoff
-           && padding_baud_rate
+           ) {
+           always_delay = FALSE;
+           normal_delay = TRUE;
+       } else {
+           always_delay = (string == bell) || (string == flash_screen);
+           normal_delay =
+               !xon_xoff
+               && padding_baud_rate
 #if NCURSES_NO_PADDING
-           && !GetNoPadding(SP_PARM)
+               && !GetNoPadding(SP_PARM)
 #endif
-           && (_nc_baudrate(ospeed) >= padding_baud_rate);
+               && (_nc_baudrate(ospeed) >= padding_baud_rate);
+       }
     }
-
 #if BSD_TPUTS
     /*
      * This ugly kluge deals with the fact that some ancient BSD programs
index 9fb132126951ca8c45b23d84022d307378398f6c..91c778f85743cc1960480427e3af3aac097eceb3 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210501) unstable; urgency=low
+ncurses6 (6.2+20210508) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 01 May 2021 05:40:30 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 08 May 2021 09:20:24 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 9fb132126951ca8c45b23d84022d307378398f6c..91c778f85743cc1960480427e3af3aac097eceb3 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210501) unstable; urgency=low
+ncurses6 (6.2+20210508) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 01 May 2021 05:40:30 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 08 May 2021 09:20:24 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 54e72bc266b461d645b026195df0e031a3679240..c78ce2e71ebc4662463d9c84f8f7747ac6dab669 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210501) unstable; urgency=low
+ncurses6 (6.2+20210508) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 01 May 2021 05:40:30 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 08 May 2021 09:20:24 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 37f63ae8b12b5b5413e91065c6fd94f3ab4f60c2..90a791dcce6a930fac6551ff95ce5cac559c50d5 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.456 2021/05/01 09:40:30 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.457 2021/05/08 13:20:24 tom Exp $\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "2"\r
 !define VERSION_YYYY  "2021"\r
-!define VERSION_MMDD  "0501"\r
+!define VERSION_MMDD  "0508"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 7b95fb23bf4dc4f068bcd0955aa56423de85a00a..4bd7e182c3b9e96ecf0e1e48bad052e2142fca79 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.2
-Release: 20210501
+Release: 20210508
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index d2b20853373fcd19ddf6e991a5f6324b6e063124..a8753c49f943af52dccfe271249691c115546e4a 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.2
-Release: 20210501
+Release: 20210508
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index deca9d8460c4984eeab9c82c7f890e1343cfbf0f..1bc1937d86e9ece3aa6f19660ca4645f7a5cf945 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.2
-Release: 20210501
+Release: 20210508
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index adaa5949e265ec917afc24bfe07f501ccd3d5260..9f3b4d22d2a62f7dce6699dfa489d2042c98a63f 100644 (file)
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_menus.c,v 1.72 2021/03/20 16:05:49 tom Exp $
+ * $Id: demo_menus.c,v 1.73 2021/05/08 19:41:08 tom Exp $
  *
  * Demonstrate a variety of functions from the menu library.
  * Thomas Dickey - 2005/4/9
@@ -565,7 +565,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++)
index 8f1792d9d88b0279c926e35d25186eb8c8c30d65..610b2d8a5172325cae5462461e833cfc1e232c15 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey                                     *
+ * Copyright 2019-2020,2021 Thomas E. Dickey                                *
  * Copyright 1998-2014,2017 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -42,7 +42,7 @@
  *
  *     Date: 05.Nov.90
  *
- * $Id: hanoi.c,v 1.41 2020/02/02 23:34:34 tom Exp $
+ * $Id: hanoi.c,v 1.42 2021/05/08 20:44:44 tom Exp $
  */
 
 #include <test.priv.h>
@@ -283,7 +283,7 @@ main(int argc, char **argv)
     }
     setlocale(LC_ALL, "");
 
-    switch (ch = (argc - optind)) {
+    switch (argc - optind) {
     case 2:
        if (strcmp(argv[optind + 1], "a")) {
            usage();
index f9f725b0fc6c96ae9270aac9ac6c19d4478f0559..08ccf225a46ce17221bbd00e1a9f8eb01c7af9e1 100644 (file)
@@ -34,7 +34,7 @@
  * Eric S. Raymond <esr@snark.thyrsus.com> July 22 1995.  Mouse support
  * added September 20th 1995.
  *
- * $Id: knight.c,v 1.48 2021/04/25 00:10:43 tom Exp $
+ * $Id: knight.c,v 1.49 2021/05/08 19:32:15 tom Exp $
  */
 
 #include <test.priv.h>
@@ -621,10 +621,10 @@ play(void)
 
        for (i = 0; i < ylimit; i++) {
            for (j = 0; j < xlimit; j++) {
-               squares[i][j] = FALSE;
                unmarkcell(i, j);
            }
        }
+       memset(squares, 0, sizeof(squares));
        memset(history, 0, sizeof(history));
        history[0].y = history[0].x = -1;
        history[1].y = history[1].x = -1;
index 37693ac4e6c07c19b2b507a0c2239a0848f2d125..966c76afa3b5ab81bd3a82fba833eee13c497513 100644 (file)
@@ -41,7 +41,7 @@ AUTHOR
    Author: Eric S. Raymond <esr@snark.thyrsus.com> 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.525 2021/05/08 19:44:31 tom Exp $
 
 ***************************************************************************/
 
@@ -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++)
index 1b4758d476e4bce735aef8f60c8ad8ad2d10575d..f95747f406f34626acd3707c36e7a2310e244645 100644 (file)
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: picsmap.c,v 1.138 2021/05/01 20:38:40 tom Exp $
+ * $Id: picsmap.c,v 1.139 2021/05/08 15:56:05 tom Exp $
  *
  * Author: Thomas E. Dickey
  *
@@ -604,7 +604,6 @@ read_palette(const char *filename)
                    continue;
                }
            }
-           s += strlen(s);
 
            if (tries & 2) {
                int len = (int) strlen(filename);
index a7ada59ec9c9b9f55e9e9d916fa0ac708698401c..b1d320bb28419bd2a8194292c24a423818db64d7 100644 (file)
@@ -27,7 +27,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_add_wchstr.c,v 1.28 2021/03/27 23:41:34 tom Exp $
+ * $Id: test_add_wchstr.c,v 1.29 2021/05/08 20:04:10 tom Exp $
  *
  * Demonstrate the waddwchstr() and wadd_wch functions.
  * Thomas Dickey - 2009/9/12
@@ -133,10 +133,10 @@ ChWLen(const wchar_t *source)
        size_t adjust = 0;
        size_t n;
 
-       for (n = 0; n < result; ++n) {
+       for (n = 0; source[n] != 0; ++n) {
            const char *s;
 
-           if (source[n] < 256 && (s = unctrl((chtype) source[n])) != 0) {
+           if ((source[n] < 256) && (s = unctrl((chtype) source[n])) != 0) {
                adjust += (strlen(s) - 1);
            }
        }
index 30a9c7ffddc8fb2fede6bc5803aaead2baee0766..c4c53c79a1dba1d674e163be0bd0bd42cdf10855 100644 (file)
@@ -52,7 +52,7 @@
  * scroll operation worked, and the refresh() code only had to do a
  * partial repaint.
  *
- * $Id: view.c,v 1.140 2021/03/27 22:42:22 tom Exp $
+ * $Id: view.c,v 1.141 2021/05/08 15:57:04 tom Exp $
  */
 
 #include <test.priv.h>
@@ -78,9 +78,7 @@ static int num_lines;
 static bool n_option = FALSE;
 #endif
 
-static GCC_NORETURN void usage(void);
-
-static void
+static GCC_NORETURN void
 failed(const char *msg)
 {
     endwin();
@@ -368,7 +366,7 @@ read_file(const char *filename)
     free(my_blob);
 }
 
-static void
+static GCC_NORETURN void
 usage(void)
 {
     static const char *msg[] =