]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.1 - patch 20180512
authorThomas E. Dickey <dickey@invisible-island.net>
Sat, 12 May 2018 23:58:52 +0000 (23:58 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sat, 12 May 2018 23:58:52 +0000 (23:58 +0000)
+ remove trailing ';' from GCC_DEPRECATED definition.
+ repair a change from 20110730 which left an error-check/warning dead.
+ fix several minor Coverity warnings.

21 files changed:
NEWS
VERSION
dist.mk
include/curses.h.in
ncurses/tinfo/captoinfo.c
ncurses/tinfo/make_hash.c
ncurses/tinfo/read_termcap.c
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
test/bs.c
test/demo_new_pair.c
test/dots_xcurses.c
test/knight.c
test/ncurses.c
test/picsmap.c
test/popup_msg.c
test/savescreen.c

diff --git a/NEWS b/NEWS
index c02a0947e80a1df3bab35eb8a006a7e7b8ea8bfc..da3b1d2692d3aa87e771391561cbe161c19a670f 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.3124 2018/05/05 21:05:04 tom Exp $
+-- $Id: NEWS,v 1.3127 2018/05/12 23:36:35 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,11 @@ 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.
 
+20180512
+       + remove trailing ';' from GCC_DEPRECATED definition.
+       + repair a change from 20110730 which left an error-check/warning dead.
+       + fix several minor Coverity warnings.
+
 20180505
        + add deprecation warnings for internal functions called by older
          versions of tack.
@@ -2582,7 +2587,7 @@ it is not possible to add this information.
          Waterlander regarding screen flicker).
 
 20121229
-       + fix coverity warnings regarding copying into fixed-size buffers.
+       + fix Coverity warnings regarding copying into fixed-size buffers.
        + add throw-declarations in the c++ binding per Coverity warning.
        + minor changes to new-items for consistent reference to bug-report
          numbers.
diff --git a/VERSION b/VERSION
index 89ec7d772649b12008e5a5637ce8870b654bd356..fc22197bd63d8441c0b57b908b2b35b615a2d407 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.1     20180505
+5:0:10 6.1     20180512
diff --git a/dist.mk b/dist.mk
index 409c37c7b77e0c33b63886dbefcd68ff84232445..8752e197aa308b9f91ca9500bfa6881fce78e780 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.1222 2018/05/02 00:12:25 tom Exp $
+# $Id: dist.mk,v 1.1223 2018/05/12 10:58:29 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 = 20180505
+NCURSES_PATCH = 20180512
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 0f95c8fe7285ec7c0392c65c5f8cbc5521d4ab8a..223f15df6e6224dd29696243dfa8ca8e84a9a547 100644 (file)
@@ -32,7 +32,7 @@
  *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
-/* $Id: curses.h.in,v 1.259 2018/05/05 21:28:04 tom Exp $ */
+/* $Id: curses.h.in,v 1.260 2018/05/12 23:35:35 tom Exp $ */
 
 #ifndef __NCURSES_H
 #define __NCURSES_H
@@ -582,7 +582,7 @@ extern NCURSES_EXPORT(int) wgetnstr_events (WINDOW *,char *,int,_nc_eventlist *)
 
 #undef  GCC_DEPRECATED
 #if (__GNUC__ - 0 > 3 || (__GNUC__ - 0 == 3 && __GNUC_MINOR__ - 0 >= 2))
-#define GCC_DEPRECATED(msg) __attribute__((deprecated));
+#define GCC_DEPRECATED(msg) __attribute__((deprecated))
 #else
 #define GCC_DEPRECATED(msg) /* nothing */
 #endif
index e552a8b61369b306de8b68971b0cf190a9e7626d..6a2252ee25406ede681d42f76d2ed7dda5aaba2e 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -97,7 +97,7 @@
 #include <ctype.h>
 #include <tic.h>
 
-MODULE_ID("$Id: captoinfo.c,v 1.95 2017/06/23 22:40:22 tom Exp $")
+MODULE_ID("$Id: captoinfo.c,v 1.96 2018/05/12 16:46:55 tom Exp $")
 
 #if 0
 #define DEBUG_THIS(p) DEBUG(9, p)
@@ -246,6 +246,8 @@ static void
 getparm(int parm, int n)
 /* push n copies of param on the terminfo stack if not already there */
 {
+    int nn;
+
     if (seenr) {
        if (parm == 1)
            parm = 2;
@@ -253,7 +255,7 @@ getparm(int parm, int n)
            parm = 1;
     }
 
-    while (n-- > 0) {
+    for (nn = 0; nn < n; ++nn) {
        dp = save_string(dp, "%p");
        dp = save_char(dp, '0' + parm);
     }
index 26d9b834eb2855c8b966634b91b64030af2a7300..c8bf911f826089da93f4da1e5e164fa6d0f1b439 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2013,2017 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -34,7 +34,6 @@
 
 /*
  *     make_hash.c --- build-time program for constructing comp_captab.c
- *
  */
 
 #include <build.priv.h>
@@ -44,7 +43,7 @@
 
 #include <ctype.h>
 
-MODULE_ID("$Id: make_hash.c,v 1.15 2017/10/23 21:19:54 tom Exp $")
+MODULE_ID("$Id: make_hash.c,v 1.17 2018/05/12 15:58:31 tom Exp $")
 
 /*
  *     _nc_make_hash_table()
@@ -156,10 +155,12 @@ parse_columns(char *buffer)
 
     int col = 0;
 
-    if (list == 0 && (list = typeCalloc(char *, (MAX_COLUMNS + 1))) == 0)
-         return (0);
-
     if (*buffer != '#') {
+       if (list == 0) {
+           list = typeCalloc(char *, (MAX_COLUMNS + 1));
+           if (list == 0)
+               return (0);
+       }
        while (*buffer != '\0') {
            char *s;
            for (s = buffer; (*s != '\0') && !isspace(UChar(*s)); s++)
@@ -225,13 +226,16 @@ main(int argc, char **argv)
      * Read the table into our arrays.
      */
     for (n = 0; (n < CAPTABSIZE) && fgets(buffer, BUFSIZ, stdin);) {
-       char **list, *nlp = strchr(buffer, '\n');
+       char **list;
+       char *nlp = strchr(buffer, '\n');
        if (nlp)
            *nlp = '\0';
+       else
+           buffer[sizeof(buffer) - 2] = '\0';
        list = parse_columns(buffer);
        if (list == 0)          /* blank or comment */
            continue;
-       if (column > count_columns(list)) {
+       if (column < 0 || column > count_columns(list)) {
            fprintf(stderr, "expected %d columns, have %d:\n%s\n",
                    column,
                    count_columns(list),
index 5e8d85ede13b44a9c85e3f7d601d23e1ce4ffbd7..6aafcb5eb2cfedbeb7f3400b0acd80207beafda9 100644 (file)
@@ -56,7 +56,7 @@
 #include <sys/types.h>
 #include <tic.h>
 
-MODULE_ID("$Id: read_termcap.c,v 1.95 2018/04/07 21:12:50 tom Exp $")
+MODULE_ID("$Id: read_termcap.c,v 1.96 2018/05/12 18:52:02 tom Exp $")
 
 #if !PURE_TERMINFO
 
@@ -364,7 +364,7 @@ _nc_getent(
                        if (bp >= b_end) {
                            int n;
 
-                           n = read(fd, buf, sizeof(buf));
+                           n = (int) read(fd, buf, sizeof(buf));
                            if (n <= 0) {
                                if (myfd)
                                    (void) close(fd);
@@ -393,7 +393,7 @@ _nc_getent(
                                || *(rp - 1) != '\\')
                                break;
                        }
-                       *rp++ = c;
+                       *rp++ = (char) c;
 
                        /*
                         * Enforce loop invariant: if no room
@@ -404,8 +404,8 @@ _nc_getent(
                            unsigned pos;
                            size_t newsize;
 
-                           pos = rp - record;
-                           newsize = r_end - record + BFRAG;
+                           pos = (unsigned) (rp - record);
+                           newsize = (size_t) (r_end - record + BFRAG);
                            record = DOALLOC(newsize);
                            if (record == 0) {
                                if (myfd)
@@ -492,14 +492,14 @@ _nc_getent(
                }
            }
            tcstart = tc - 3;
-           tclen = s - tcstart;
+           tclen = (int) (s - tcstart);
            tcend = s;
 
            icap = 0;
            iret = _nc_getent(&icap, &ilen, &oline, current, db_array, fd,
                              tc, depth + 1, 0);
            newicap = icap;     /* Put into a register. */
-           newilen = ilen;
+           newilen = (int) ilen;
            if (iret != TC_SUCCESS) {
                /* an error */
                if (iret < TC_NOT_FOUND) {
@@ -523,7 +523,7 @@ _nc_getent(
            /* not interested in name field of tc'ed record */
            s = newicap;
            while (*s != '\0' && *s++ != ':') ;
-           newilen -= s - newicap;
+           newilen -= (int) (s - newicap);
            newicap = s;
 
            /* make sure interpolated record is `:'-terminated */
@@ -542,10 +542,10 @@ _nc_getent(
                unsigned pos, tcpos, tcposend;
                size_t newsize;
 
-               pos = rp - record;
-               newsize = r_end - record + diff + BFRAG;
-               tcpos = tcstart - record;
-               tcposend = tcend - record;
+               pos = (unsigned) (rp - record);
+               newsize = (size_t) (r_end - record + diff + BFRAG);
+               tcpos = (unsigned) (tcstart - record);
+               tcposend = (unsigned) (tcend - record);
                record = DOALLOC(newsize);
                if (record == 0) {
                    if (myfd)
@@ -583,7 +583,7 @@ _nc_getent(
      */
     if (myfd)
        (void) close(fd);
-    *len = rp - record - 1;    /* don't count NUL */
+    *len = (unsigned) (rp - record - 1);       /* don't count NUL */
     if (r_end > rp) {
        if ((record = DOALLOC((size_t) (rp - record))) == 0) {
            errno = ENOMEM;
index b842644205dbb905fd062091426a7179b6dd7d05..c81517c7891efdd405674aeccc82b4575d8e52e3 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20180505) unstable; urgency=low
+ncurses6 (6.1+20180512) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Tue, 01 May 2018 20:12:25 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 12 May 2018 06:58:29 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index b842644205dbb905fd062091426a7179b6dd7d05..c81517c7891efdd405674aeccc82b4575d8e52e3 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20180505) unstable; urgency=low
+ncurses6 (6.1+20180512) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Tue, 01 May 2018 20:12:25 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 12 May 2018 06:58:29 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 1fdb7675292095bb4f60ced2de2afe7be0309f7e..fa12a8186b84bcb80674b6e70dedecff14074ceb 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20180505) unstable; urgency=low
+ncurses6 (6.1+20180512) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Tue, 01 May 2018 20:12:25 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 12 May 2018 06:58:29 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 4391cb083d3d702ee26a30fbe6d74d43970448f5..459bc6d8502744766935c99bf36fb7a325cbca74 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.269 2018/05/02 00:12:25 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.270 2018/05/12 10:58:29 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  "2018"\r
-!define VERSION_MMDD  "0505"\r
+!define VERSION_MMDD  "0512"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index 12a749b7b7aebe24b874ed3ca97c929823455fd2..519b99136ff8eec18cd9278d554b1723e737dd0a 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.1
-Release: 20180505
+Release: 20180512
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 08b2dee4e8c71513d6f68bef965eeeb3dc24d29d..291eba5eb5da1c152cd2a2667ea1194b6d98063e 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.1
-Release: 20180505
+Release: 20180512
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 31f98bb8684dc3754d8976a0bd26ff85c00411da..b8893e6243beba33acf724d4ba33f78b3d3ec91d 100644 (file)
--- a/test/bs.c
+++ b/test/bs.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -34,7 +34,7 @@
  * v2.0 featuring strict ANSI/POSIX conformance, November 1993.
  * v2.1 with ncurses mouse support, September 1995
  *
- * $Id: bs.c,v 1.71 2017/10/18 23:03:07 tom Exp $
+ * $Id: bs.c,v 1.73 2018/05/12 15:07:51 tom Exp $
  */
 
 #include <test.priv.h>
@@ -116,17 +116,20 @@ static char *your_name;
 static char dftname[] = "stranger";
 
 /* direction constants */
-#define E      0
-#define SE     1
-#define S      2
-#define SW     3
-#define W      4
-#define NW     5
-#define N      6
-#define NE     7
-static int xincr[8] =
+typedef enum {
+    dir_E = 0
+    ,dir_SE
+    ,dir_S
+    ,dir_SW
+    ,dir_W
+    ,dir_NW
+    ,dir_N
+    ,dir_NE
+    ,dir_MAX
+} DIRECTIONS;
+static int xincr[dir_MAX + 2] =
 {1, 1, 0, -1, -1, -1, 0, 1};
-static int yincr[8] =
+static int yincr[dir_MAX + 2] =
 {0, 1, 1, 1, 0, -1, -1, -1};
 
 /* current ship position and direction */
@@ -327,9 +330,9 @@ randomplace(int b, ship_t * ss)
 {
 
     do {
-       ss->dir = rnd(2) ? E : S;
-       ss->x = rnd(BWIDTH - (ss->dir == E ? ss->length : 0));
-       ss->y = rnd(BDEPTH - (ss->dir == S ? ss->length : 0));
+       ss->dir = rnd(2) ? dir_E : dir_S;
+       ss->x = rnd(BWIDTH - (ss->dir == dir_E ? ss->length : 0));
+       ss->y = rnd(BDEPTH - (ss->dir == dir_S ? ss->length : 0));
     } while
        (!checkplace(b, ss, FALSE));
 }
@@ -495,19 +498,19 @@ initgame(void)
            switch (c) {
            case 'k':
            case '8':
-               ss->dir = N;
+               ss->dir = dir_N;
                break;
            case 'j':
            case '2':
-               ss->dir = S;
+               ss->dir = dir_S;
                break;
            case 'h':
            case '4':
-               ss->dir = W;
+               ss->dir = dir_W;
                break;
            case 'l':
            case '6':
-               ss->dir = E;
+               ss->dir = dir_E;
                break;
            }
 
@@ -665,7 +668,7 @@ collidecheck(int b, int y, int x)
     if (!closepack) {
        int i;
 
-       for (i = 0; i < 8; i++) {
+       for (i = 0; i < dir_MAX; i++) {
            int xend, yend;
 
            yend = y + yincr[i];
@@ -762,8 +765,8 @@ hitship(int x, int y)
 
                if (!closepack)
                    for (j = -1; j <= 1; j++) {
-                       int bx = ss->x + j * xincr[(ss->dir + 2) % 8];
-                       int by = ss->y + j * yincr[(ss->dir + 2) % 8];
+                       int bx = ss->x + j * xincr[(ss->dir + 2) % dir_MAX];
+                       int by = ss->y + j * yincr[(ss->dir + 2) % dir_MAX];
 
                        for (i = -1; i <= ss->length; ++i) {
                            int x1, y1;
@@ -1027,11 +1030,14 @@ cputurn(void)
        break;
 
     case RANDOM_HIT:           /* last shot was random and hit */
-       used[E / 2] = used[S / 2] = used[W / 2] = used[N / 2] = FALSE;
+       used[dir_E / 2] =
+           used[dir_S / 2] =
+           used[dir_W / 2] =
+           used[dir_N / 2] = FALSE;
        /* FALLTHROUGH */
 
     case HUNT_DIRECT:          /* last shot hit, we're looking for ship's long axis */
-       for (d = navail = 0; d < 4; d++) {
+       for (d = navail = 0; d < (dir_MAX) / 2; d++) {
            x = ts.x + xincr[d * 2];
            y = ts.y + yincr[d * 2];
            if (!used[d] && POSSIBLE(x, y))
@@ -1043,13 +1049,13 @@ cputurn(void)
            goto refire;        /* ...so we must random-fire */
        else {
            n = rnd(navail) + 1;
-           for (d = 0; d < 4 && used[d]; d++) ;
+           for (d = 0; d < (dir_MAX) / 2 && used[d]; d++) ;
            /* used[d] is first that == 0 */
            for (; n > 1; n--)
-               while (d < 4 && used[++d]) ;
+               while (d < (dir_MAX) / 2 && used[++d]) ;
            /* used[d] is next that == 0 */
 
-           assert(d < 4);
+           assert(d < (dir_MAX) / 2);
            assert(used[d] == FALSE);
 
            used[d] = TRUE;
@@ -1083,7 +1089,7 @@ cputurn(void)
        break;
 
     case REVERSE_JUMP:         /* nail down the ship's other end */
-       d = (ts.dir + 4) % 8;
+       d = (ts.dir + (dir_MAX) / 2) % dir_MAX;
        x = ts.x + ts.hits * xincr[d];
        y = ts.y + ts.hits * yincr[d];
        if (POSSIBLE(x, y) && (hit = cpufire(x, y))) {
index 4067c8817ad3532f43174415272233e90fdbb860..a4cbb5370dcbec8ba03fc7db13ba56dced2873c8 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2017 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2017,2018 Free Software Foundation, Inc.                   *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: demo_new_pair.c,v 1.18 2017/10/11 22:16:14 tom Exp $
+ * $Id: demo_new_pair.c,v 1.19 2018/05/12 14:30:04 tom Exp $
  *
  * Demonstrate the alloc_pair() function.
  */
@@ -223,7 +223,7 @@ main(int argc, char *argv[])
 
     if (isatty(fileno(stderr))) {
        output = stderr;
-    } else if ((ch = open("/dev/tty", O_WRONLY)) != 0) {
+    } else if ((ch = open("/dev/tty", O_WRONLY)) >= 0) {
        output = fdopen(ch, "w");
     } else {
        fprintf(stderr, "cannot open terminal for output\n");
index f86cd8d16b3318c9fbf096c02e517720e4b60a26..c9fb5b6e9eef8d6d38926d8aa93b6c205d9f4add 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2017 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2017,2018 Free Software Foundation, Inc.                   *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: dots_xcurses.c,v 1.14 2017/12/09 21:04:41 tom Exp $
+ * $Id: dots_xcurses.c,v 1.15 2018/05/12 16:08:07 tom Exp $
  *
  * A simple demo of the wide-curses interface used for comparison with termcap.
  */
@@ -103,7 +103,7 @@ set_colors(int fg, int bg)
 {
     int pair = mypair(fg, bg);
     if (pair > 0) {
-       color_set((short) pair, NewPair(pair));
+       (void) color_set((short) pair, NewPair(pair));
     }
 }
 
index b95996c608178b45eda852376796916560abd2c6..0d6675e5ba1689ad22ee843b7bbb2d8fec11c1a1 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2013,2017 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -33,7 +33,7 @@
  * Eric S. Raymond <esr@snark.thyrsus.com> July 22 1995.  Mouse support
  * added September 20th 1995.
  *
- * $Id: knight.c,v 1.43 2017/09/10 00:13:02 tom Exp $
+ * $Id: knight.c,v 1.44 2018/05/12 13:23:24 tom Exp $
  */
 
 #include <test.priv.h>
@@ -417,7 +417,7 @@ drawMove(SQUARES squares, int count_moves, chtype tchar, int oldy, int oldx, int
                } else {
                    cellmove(i, j);
                    if (winch(boardwin) == minus)
-                       waddch(boardwin, count_moves ? ' ' : minus);
+                       waddch(boardwin, ' ');
                }
            }
        }
index 86a842c30407e63ba3e1e9e692b6b290c7fee938..ff46265f43cbdb43c8f2dbcbc844b936ed8dd7af 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -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.504 2017/11/24 20:51:18 tom Exp $
+$Id: ncurses.c,v 1.506 2018/05/12 16:00:22 tom Exp $
 
 ***************************************************************************/
 
@@ -7170,9 +7170,12 @@ overlap_test(bool recur GCC_UNUSED)
     int shift = 0, last_refresh = -1;
     int state, flavor[OVERLAP_FLAVORS];
 
-    if ((win1 = make_overlap(0)) == 0
-       || (win2 = make_overlap(1)) == 0)
+    if ((win1 = make_overlap(0)) == 0) {
        return ERR;
+    } else if ((win2 = make_overlap(1)) == 0) {
+       delwin(win1);
+       return ERR;
+    }
 
     curs_set(0);
     raw();
@@ -7367,9 +7370,12 @@ x_overlap_test(bool recur GCC_UNUSED)
     int shift = 0, last_refresh = -1;
     int state, flavor[OVERLAP_FLAVORS];
 
-    if ((win1 = make_overlap(0)) == 0
-       || (win2 = make_overlap(1)) == 0)
+    if ((win1 = make_overlap(0)) == 0) {
        return ERR;
+    } else if ((win2 = make_overlap(1)) == 0) {
+       delwin(win1);
+       return ERR;
+    }
 
     curs_set(0);
     raw();
index 4e5b2634d2ca39f2f84a1a84e5941ed98b96ecfe..303bc404a9de56baa0c03b32eeabad2874800476 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: picsmap.c,v 1.118 2018/03/24 22:37:42 tom Exp $
+ * $Id: picsmap.c,v 1.121 2018/05/12 16:28:46 tom Exp $
  *
  * Author: Thomas E. Dickey
  *
@@ -584,6 +584,7 @@ read_palette(const char *filename)
            strcpy(s, filename);
            if (tries & 4) {
                char *t = s;
+               char *tc;
                int num;
                char chr;
                int found = 0;
@@ -591,7 +592,8 @@ read_palette(const char *filename)
                    if (*t == '-') {
                        if (sscanf(t, "-%d%c", &num, &chr) == 2 &&
                            chr == 'c' &&
-                           !(strncmp) (strchr(t, chr), "color", 5)) {
+                           (tc = strchr(t, chr)) != 0 &&
+                           !(strncmp) (tc, "color", 5)) {
                            found = 1;
                        }
                        break;
@@ -1009,6 +1011,8 @@ parse_xbm(char **data)
                } else if ((t = strstr(buf, "_height")) != 0) {
                    state |= 2;
                    result->high = (short) num;
+               } else {
+                   break;
                }
                *t = '\0';
                if (result->name) {
@@ -1190,7 +1194,7 @@ parse_xpm(char **data)
            if (num_colors >= result->colors) {
                finish_c_values(result);
                state = 4;
-               if (list != 0 && list[0] == 0)
+               if (list[0] == 0)
                    list[0] = strdup("\033");
            }
            break;
index 5a351731a25e14f8d6adbedc99e22a0e4c34e5d6..4acfe851d4b56fe28548ba81182b833b44cf68ea 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2017 Free Software Foundation, Inc.                        *
+ * Copyright (c) 2017,2018 Free Software Foundation, Inc.                   *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: popup_msg.c,v 1.8 2017/09/03 21:05:01 tom Exp $
+ * $Id: popup_msg.c,v 1.9 2018/05/12 15:08:45 tom Exp $
  *
  * Show a multi-line message in a window which may extend beyond the screen.
  *
@@ -86,8 +86,10 @@ popup_msg(WINDOW *parent, const char *const *msg)
 
     if ((help = newwin(high, wide, y0, x0)) == 0)
        return;
-    if ((data = newpad(length + 1, width)) == 0)
+    if ((data = newpad(length + 1, width)) == 0) {
+       delwin(help);
        return;
+    }
 
     begin_popup();
 
index 610b86d041bd1dd07730b7d63fd03099c80ecdbb..9d88079f94c3a5f8719db7be7b3d161465f1521d 100644 (file)
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: savescreen.c,v 1.52 2018/02/03 23:18:50 tom Exp $
+ * $Id: savescreen.c,v 1.53 2018/05/12 15:11:16 tom Exp $
  *
  * Demonstrate save/restore functions from the curses library.
  * Thomas Dickey - 2007/7/14
@@ -69,10 +69,12 @@ static wchar_t
 BaseChar(cchar_t data)
 {
     wchar_t my_wchar[CCHARW_MAX];
+    wchar_t result = 0;
     attr_t my_attr;
     short my_pair;
-    getcchar(&data, my_wchar, &my_attr, &my_pair, NULL);
-    return my_wchar[0];
+    if (getcchar(&data, my_wchar, &my_attr, &my_pair, NULL) == OK)
+       result = my_wchar[0];
+    return result;
 }
 #endif