]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.1 - patch 20190810
authorThomas E. Dickey <dickey@invisible-island.net>
Sat, 10 Aug 2019 23:58:30 +0000 (23:58 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sat, 10 Aug 2019 23:58:30 +0000 (23:58 +0000)
+ fix a few more coverity warnings.

15 files changed:
NEWS
VERSION
dist.mk
ncurses/base/lib_mouse.c
ncurses/tinfo/lib_setup.c
ncurses/tinfo/tinfo_driver.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/ncurses.c

diff --git a/NEWS b/NEWS
index bae5f746ee155d084dbd7ec5ebdc293b4e473707..1f356c4ba01f179ee1b44f1df6d33842b34472d9 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3359 2019/08/03 22:31:47 tom Exp $
+-- $Id: NEWS,v 1.3361 2019/08/10 19:05:52 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,9 @@ 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.
 
+20190810
+       + fix a few more coverity warnings.
+
 20190803
        + improve loop limits in _nc_scroll_window() to handle a case where
          the scrolled data is a pad which is taller than the window (patch
diff --git a/VERSION b/VERSION
index ffb0171ec4f0602ef27d89d5593a30cae7485a90..f1fe46df10a0da6cc671f56b34908c1273012205 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.1     20190803
+5:0:10 6.1     20190810
diff --git a/dist.mk b/dist.mk
index 9cce7f563d0e2f415a89a8dec6232dd5f7c2f65a..bc0ff9856fb34b64042bf27520cd60fabb556f1c 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.1299 2019/08/03 13:57:42 tom Exp $
+# $Id: dist.mk,v 1.1300 2019/08/10 12:52:53 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -37,7 +37,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 6
 NCURSES_MINOR = 1
-NCURSES_PATCH = 20190803
+NCURSES_PATCH = 20190810
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 891b7d55c21e27e8b0dfbabba4fef69a38195fc4..34723f08941ab07daff8517010640aa85a16c91b 100644 (file)
@@ -84,7 +84,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_mouse.c,v 1.182 2019/07/20 20:42:43 tom Exp $")
+MODULE_ID("$Id: lib_mouse.c,v 1.183 2019/08/10 17:11:50 tom Exp $")
 
 #include <tic.h>
 
@@ -438,7 +438,7 @@ allow_gpm_mouse(SCREEN *sp GCC_UNUSED)
 
 #if USE_WEAK_SYMBOLS
     /* Danger Robinson: do not use dlopen for libgpm if already loaded */
-    if ((Gpm_Wgetch)) {
+    if ((Gpm_Wgetch) != 0) {
        if (!sp->_mouse_gpm_loaded) {
            T(("GPM library was already dlopen'd, not by us"));
        }
index 04acfb496e972cc65d65e5b1bbf54012cd3e35f4..b1d1e1ae8213adb17ac19e9f8cfee22054d61e23 100644 (file)
@@ -48,7 +48,7 @@
 #include <locale.h>
 #endif
 
-MODULE_ID("$Id: lib_setup.c,v 1.202 2019/07/28 19:33:40 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.204 2019/08/10 17:08:00 tom Exp $")
 
 /****************************************************************************
  *
@@ -446,23 +446,24 @@ _nc_update_screensize(SCREEN *sp)
     int old_cols = columns;
 #endif
 
-    TINFO_GET_SIZE(sp, sp->_term, &new_lines, &new_cols);
-
-    /*
-     * See is_term_resized() and resizeterm().
-     * We're doing it this way because those functions belong to the upper
-     * ncurses library, while this resides in the lower terminfo library.
-     */
-    if (sp != 0 && sp->_resize != 0) {
-       if ((new_lines != old_lines) || (new_cols != old_cols)) {
-           sp->_resize(NCURSES_SP_ARGx new_lines, new_cols);
-       } else if (sp->_sig_winch && (sp->_ungetch != 0)) {
-           sp->_ungetch(SP_PARM, KEY_RESIZE);  /* so application can know this */
+    if (sp != 0) {
+       TINFO_GET_SIZE(sp, sp->_term, &new_lines, &new_cols);
+       /*
+        * See is_term_resized() and resizeterm().
+        * We're doing it this way because those functions belong to the upper
+        * ncurses library, while this resides in the lower terminfo library.
+        */
+       if (sp->_resize != 0) {
+           if ((new_lines != old_lines) || (new_cols != old_cols)) {
+               sp->_resize(NCURSES_SP_ARGx new_lines, new_cols);
+           } else if (sp->_sig_winch && (sp->_ungetch != 0)) {
+               sp->_ungetch(SP_PARM, KEY_RESIZE);      /* so application can know this */
+           }
+           sp->_sig_winch = FALSE;
        }
-       sp->_sig_winch = FALSE;
     }
 }
-#endif
+#endif /* USE_SIZECHANGE */
 
 /****************************************************************************
  *
@@ -776,6 +777,8 @@ TINFO_SETUP_TERM(TERMINAL **tp,
            } else if (status == TGETENT_NO) {
                ret_error1(status, "unknown terminal type.\n",
                           myname, free(myname));
+           } else {
+               ret_error0(status, "unexpected return-code\n");
            }
        }
 #if NCURSES_EXT_NUMBERS
index 9b6dbb72174aa86c4370165faa3a492d8c7fc790..450cded0561e42d1a48bba70be87e87412ea894d 100644 (file)
@@ -51,7 +51,7 @@
 # endif
 #endif
 
-MODULE_ID("$Id: tinfo_driver.c,v 1.64 2019/07/28 18:43:09 tom Exp $")
+MODULE_ID("$Id: tinfo_driver.c,v 1.66 2019/08/10 18:36:08 tom Exp $")
 
 /*
  * SCO defines TIOCGSIZE and the corresponding struct.  Other systems (SunOS,
@@ -188,6 +188,8 @@ drv_CanHandle(TERMINAL_CONTROL_BLOCK * TCB, const char *tname, int *errret)
        } else if (status == TGETENT_NO) {
            ret_error1(status, "unknown terminal type.\n",
                       tname, NO_COPY);
+       } else {
+           ret_error0(status, "unexpected return-code\n");
        }
     }
     result = TRUE;
@@ -1340,23 +1342,29 @@ drv_keyok(TERMINAL_CONTROL_BLOCK * TCB, int c, int flag)
        unsigned ch = (unsigned) c;
        if (flag) {
            while ((s = _nc_expand_try(sp->_key_ok,
-                                      ch, &count, (size_t) 0)) != 0
-                  && _nc_remove_key(&(sp->_key_ok), ch)) {
-               code = _nc_add_to_try(&(sp->_keytry), s, ch);
-               free(s);
-               count = 0;
-               if (code != OK)
-                   break;
+                                      ch, &count, (size_t) 0)) != 0) {
+               if (_nc_remove_key(&(sp->_key_ok), ch)) {
+                   code = _nc_add_to_try(&(sp->_keytry), s, ch);
+                   free(s);
+                   count = 0;
+                   if (code != OK)
+                       break;
+               } else {
+                   free(s);
+               }
            }
        } else {
            while ((s = _nc_expand_try(sp->_keytry,
-                                      ch, &count, (size_t) 0)) != 0
-                  && _nc_remove_key(&(sp->_keytry), ch)) {
-               code = _nc_add_to_try(&(sp->_key_ok), s, ch);
-               free(s);
-               count = 0;
-               if (code != OK)
-                   break;
+                                      ch, &count, (size_t) 0)) != 0) {
+               if (_nc_remove_key(&(sp->_keytry), ch)) {
+                   code = _nc_add_to_try(&(sp->_key_ok), s, ch);
+                   free(s);
+                   count = 0;
+                   if (code != OK)
+                       break;
+               } else {
+                   free(s);
+               }
            }
        }
     }
index 7ec38ab1bd186a4be8a50ccd6af2a12c3054a1ce..f035c1122d7e04ec3e59b62375812b92858aa5c1 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20190803) unstable; urgency=low
+ncurses6 (6.1+20190810) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 03 Aug 2019 09:57:42 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 10 Aug 2019 08:52:53 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 7ec38ab1bd186a4be8a50ccd6af2a12c3054a1ce..f035c1122d7e04ec3e59b62375812b92858aa5c1 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20190803) unstable; urgency=low
+ncurses6 (6.1+20190810) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 03 Aug 2019 09:57:42 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 10 Aug 2019 08:52:53 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 052c1249dbf34121fdcee74265f9817882047589..3edff2ebc4f897a3037ac174451327edb75f6a05 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20190803) unstable; urgency=low
+ncurses6 (6.1+20190810) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 03 Aug 2019 09:57:42 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 10 Aug 2019 08:52:53 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index ac42149fe1b75e56392928f19d990a84800889e6..41acfea1505d0b93fa6e054a9a1a6c06506aab16 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.345 2019/08/03 13:57:42 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.346 2019/08/10 12:52:53 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 "1"\r
 !define VERSION_YYYY  "2019"\r
-!define VERSION_MMDD  "0803"\r
+!define VERSION_MMDD  "0810"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 165a4d6165305d414a438c79fae8d8d850117352..1181f3821f67b75e8f9368424aba5773acaa8bdb 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.1
-Release: 20190803
+Release: 20190810
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 935b16d16639821722536bf939e46a8e0d7ac01d..2fc4434eab91b72143efa58db28e4e3e03192c36 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.1
-Release: 20190803
+Release: 20190810
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 6b6df00b0e09d2fd4ff5a8da0df04017dfcab479..51ad7103fb6c76baec9cb4e4a63d153d2d119525 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.1
-Release: 20190803
+Release: 20190810
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 5673deff216dd231386111798e91e8d4bfe0f885..844afa7e26e0ab4a648b0b6ec0f9bade4c6bdd7e 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_menus.c,v 1.66 2019/04/06 20:42:48 tom Exp $
+ * $Id: demo_menus.c,v 1.67 2019/08/10 19:25:27 tom Exp $
  *
  * Demonstrate a variety of functions from the menu library.
  * Thomas Dickey - 2005/4/9
@@ -110,6 +110,8 @@ static WINDOW *status;
 static bool loaded_file = FALSE;
 
 static char empty[1];
+
+#ifdef TRACE
 static void failed(const char *s) GCC_NORETURN;
 
 static void
@@ -119,6 +121,7 @@ failed(const char *s)
     endwin();
     ExitProgram(EXIT_FAILURE);
 }
+#endif
 
 /* Common function to allow ^T to toggle trace-mode in the middle of a test
  * so that trace-files can be made smaller.
index 9088f96f095f9e4e4d22f258d3b71f8fb9f28b22..ce72252a2dd558c9a6d44d5369921aad36354558 100644 (file)
@@ -40,7 +40,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.515 2019/04/20 20:34:11 tom Exp $
+$Id: ncurses.c,v 1.516 2019/08/10 19:38:41 tom Exp $
 
 ***************************************************************************/
 
@@ -7876,11 +7876,15 @@ main(int argc, char *argv[])
 {
     int c;
     int my_e_param = 1;
+#ifdef NCURSES_VERSION_PATCH
 #if HAVE_USE_DEFAULT_COLORS
     int default_fg = COLOR_WHITE;
     int default_bg = COLOR_BLACK;
-    bool assumed_colors = FALSE;
     bool default_colors = FALSE;
+#if HAVE_ASSUME_DEFAULT_COLORS
+    bool assumed_colors = FALSE;
+#endif
+#endif
 #endif
     bool monochrome = FALSE;
 #if HAVE_COLOR_CONTENT
@@ -7892,7 +7896,9 @@ main(int argc, char *argv[])
 
     while ((c = getopt(argc, argv, "a:dEe:fhmp:s:Tt:x")) != -1) {
        switch (c) {
+#ifdef NCURSES_VERSION_PATCH
 #if HAVE_USE_DEFAULT_COLORS
+#if HAVE_ASSUME_DEFAULT_COLORS
        case 'a':
            assumed_colors = TRUE;
            switch (sscanf(optarg, "%d,%d", &default_fg, &default_bg)) {
@@ -7904,10 +7910,12 @@ main(int argc, char *argv[])
                break;
            }
            break;
+#endif
        case 'd':
            default_colors = TRUE;
            break;
 #endif
+#endif
 #if HAVE_USE_ENV
        case 'E':
            use_env(FALSE);