From: Thomas E. Dickey Date: Sun, 11 Oct 2009 00:32:49 +0000 (+0000) Subject: ncurses 5.7 - patch 20091010 X-Git-Tag: v5.8~67 X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=59108c98bda25ae50b3a319e2bcb7f4b9a174024 ncurses 5.7 - patch 20091010 + supply a null-terminator to buffer in _nc_viswibuf(). + fix a sign-extension bug in unget_wch() (report by Mike Gran). + minor fixes to error-returns in default function for tputs, as well as in lib_screen.c --- diff --git a/NEWS b/NEWS index f6100a5b..290024f7 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.1446 2009/10/03 21:21:16 tom Exp $ +-- $Id: NEWS,v 1.1449 2009/10/10 20:41:36 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,12 @@ 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. +20091010 + + supply a null-terminator to buffer in _nc_viswibuf(). + + fix a sign-extension bug in unget_wch() (report by Mike Gran). + + minor fixes to error-returns in default function for tputs, as well + as in lib_screen.c + 20091003 + add WACS_xxx definitions to wide-character configuration for thick- and double-lines (discussion with Slava Zanko). diff --git a/dist.mk b/dist.mk index 433bb1c3..dec30479 100644 --- 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.724 2009/10/03 13:39:55 tom Exp $ +# $Id: dist.mk,v 1.725 2009/10/10 15:29:50 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 = 5 NCURSES_MINOR = 7 -NCURSES_PATCH = 20091003 +NCURSES_PATCH = 20091010 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/form/frm_driver.c b/form/frm_driver.c index 8d9bd3ba..4847149e 100644 --- a/form/frm_driver.c +++ b/form/frm_driver.c @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_driver.c,v 1.90 2009/08/29 19:02:25 tom Exp $") +MODULE_ID("$Id: frm_driver.c,v 1.91 2009/10/10 16:17:01 tom Exp $") /*---------------------------------------------------------------------------- This is the core module of the form library. It contains the majority @@ -4534,7 +4534,7 @@ _nc_Widen_String(char *source, int *lengthp) source[passed + tries] = 0; reset_mbytes(state); status = trans_mbytes(wch, source + passed, tries, state); - source[passed + tries] = save; + source[passed + tries] = (char)save; if (status > 0) { diff --git a/form/frm_req_name.c b/form/frm_req_name.c index 7ac9abe6..99abd7e3 100644 --- a/form/frm_req_name.c +++ b/form/frm_req_name.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 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 * @@ -37,7 +37,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_req_name.c,v 1.16 2008/07/05 23:22:08 tom Exp $") +MODULE_ID("$Id: frm_req_name.c,v 1.17 2009/10/10 16:17:01 tom Exp $") static const char *request_names[MAX_FORM_COMMAND - MIN_FORM_COMMAND + 1] = { @@ -154,14 +154,14 @@ form_request_by_name(const char *str) strncpy(buf, str, sizeof(buf)); while ((i < sizeof(buf)) && (buf[i] != '\0')) { - buf[i] = toupper(UChar(buf[i])); + buf[i] = (char)toupper(UChar(buf[i])); i++; } for (i = 0; i < A_SIZE; i++) { if (strncmp(request_names[i], buf, sizeof(buf)) == 0) - returnCode(MIN_FORM_COMMAND + (int) i); + returnCode(MIN_FORM_COMMAND + (int)i); } } RETURN(E_NO_MATCH); diff --git a/menu/m_req_name.c b/menu/m_req_name.c index 6fd51b1c..cad87580 100644 --- a/menu/m_req_name.c +++ b/menu/m_req_name.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2005,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 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 * @@ -37,7 +37,7 @@ #include "menu.priv.h" -MODULE_ID("$Id: m_req_name.c,v 1.20 2008/09/13 18:59:17 tom Exp $") +MODULE_ID("$Id: m_req_name.c,v 1.21 2009/10/10 16:17:23 tom Exp $") static const char *request_names[MAX_MENU_COMMAND - MIN_MENU_COMMAND + 1] = { @@ -109,7 +109,7 @@ menu_request_by_name(const char *str) strncpy(buf, str, sizeof(buf)); while ((i < sizeof(buf)) && (buf[i] != '\0')) { - buf[i] = toupper(UChar(buf[i])); + buf[i] = (char)toupper(UChar(buf[i])); i++; } diff --git a/ncurses/base/lib_screen.c b/ncurses/base/lib_screen.c index 176edc4e..34af68a3 100644 --- a/ncurses/base/lib_screen.c +++ b/ncurses/base/lib_screen.c @@ -39,7 +39,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_screen.c,v 1.35 2009/06/06 20:26:17 tom Exp $") +MODULE_ID("$Id: lib_screen.c,v 1.37 2009/10/10 19:37:07 tom Exp $") #define MAX_SIZE 0x3fff /* 16k is big enough for a window or pad */ @@ -52,17 +52,19 @@ NCURSES_SP_NAME(getwin) (NCURSES_SP_DCLx FILE *filep) T((T_CALLED("getwin(%p)"), filep)); clearerr(filep); - (void) fread(&tmp, sizeof(WINDOW), 1, filep); - if (ferror(filep) + if (fread(&tmp, 1, sizeof(WINDOW), filep) < sizeof(WINDOW) + || ferror(filep) || tmp._maxy == 0 || tmp._maxy > MAX_SIZE || tmp._maxx == 0 - || tmp._maxx > MAX_SIZE) + || tmp._maxx > MAX_SIZE) { returnWin(0); + } if (tmp._flags & _ISPAD) { nwin = NCURSES_SP_NAME(newpad) (NCURSES_SP_ARGx - tmp._maxy + 1, tmp._maxx + 1); + tmp._maxy + 1, + tmp._maxx + 1); } else { nwin = NCURSES_SP_NAME(newwin) (NCURSES_SP_ARGx tmp._maxy + 1, @@ -75,6 +77,8 @@ NCURSES_SP_NAME(getwin) (NCURSES_SP_DCLx FILE *filep) * made sense is probably gone. */ if (nwin != 0) { + size_t linesize = sizeof(NCURSES_CH_T) * (size_t) (tmp._maxx + 1); + nwin->_curx = tmp._curx; nwin->_cury = tmp._cury; nwin->_maxy = tmp._maxy; @@ -106,11 +110,8 @@ NCURSES_SP_NAME(getwin) (NCURSES_SP_DCLx FILE *filep) for (n = 0; n <= nwin->_maxy; n++) { clearerr(filep); - (void) fread(nwin->_line[n].text, - sizeof(NCURSES_CH_T), - (size_t) (nwin->_maxx + 1), - filep); - if (ferror(filep)) { + if (fread(nwin->_line[n].text, 1, linesize, filep) < linesize + || ferror(filep)) { delwin(nwin); returnWin(0); } diff --git a/ncurses/tinfo/lib_tputs.c b/ncurses/tinfo/lib_tputs.c index b123ccee..9d859527 100644 --- a/ncurses/tinfo/lib_tputs.c +++ b/ncurses/tinfo/lib_tputs.c @@ -51,7 +51,7 @@ #include /* ospeed */ #include -MODULE_ID("$Id: lib_tputs.c,v 1.77 2009/06/07 13:59:11 tom Exp $") +MODULE_ID("$Id: lib_tputs.c,v 1.78 2009/10/10 16:01:42 tom Exp $") NCURSES_EXPORT_VAR(char) PC = 0; /* used by termcap library */ NCURSES_EXPORT_VAR(NCURSES_OSPEED) ospeed = 0; /* used by termcap library */ @@ -129,21 +129,25 @@ _nc_flush(void) NCURSES_EXPORT(int) NCURSES_SP_NAME(_nc_outch) (NCURSES_SP_DCLx int ch) { + int rc = OK; + COUNT_OUTCHARS(1); if (HasTInfoTerminal(SP_PARM) && SP_PARM != 0 && SP_PARM->_cleanup) { - char tmp = ch; + char tmp = (char) ch; /* * POSIX says write() is safe in a signal handler, but the * buffered I/O is not. */ - write(fileno(NC_OUTPUT(SP_PARM)), &tmp, 1); + if (write(fileno(NC_OUTPUT(SP_PARM)), &tmp, 1) == -1) + rc = ERR; } else { - putc(ch, NC_OUTPUT(SP_PARM)); + if (putc(ch, NC_OUTPUT(SP_PARM)) == EOF) + rc = ERR; } - return OK; + return rc; } #if NCURSES_SP_FUNCS diff --git a/ncurses/trace/visbuf.c b/ncurses/trace/visbuf.c index 0b64ccc6..820f84cb 100644 --- a/ncurses/trace/visbuf.c +++ b/ncurses/trace/visbuf.c @@ -42,7 +42,7 @@ #include #include -MODULE_ID("$Id: visbuf.c,v 1.33 2009/07/11 14:44:20 tom Exp $") +MODULE_ID("$Id: visbuf.c,v 1.34 2009/10/10 20:41:55 tom Exp $") #define NUM_VISBUFS 4 @@ -238,7 +238,9 @@ _nc_viswibuf(const wint_t *buf) static unsigned mylen; unsigned n; - for (n = 0; buf[n] != 0; ++n) ; + for (n = 0; buf[n] != 0; ++n) { + ; /* empty */ + } if (mylen < ++n) { mylen = n + 80; if (mybuf != 0) @@ -246,8 +248,10 @@ _nc_viswibuf(const wint_t *buf) else mybuf = typeMalloc(wchar_t, mylen); } - for (n = 0; buf[n] != 0; ++n) + for (n = 0; buf[n] != 0; ++n) { mybuf[n] = (wchar_t) buf[n]; + } + mybuf[n] = L'\0'; return _nc_viswbuf2(0, mybuf); } diff --git a/ncurses/widechar/lib_unget_wch.c b/ncurses/widechar/lib_unget_wch.c index 1d2cf83e..d17e618c 100644 --- a/ncurses/widechar/lib_unget_wch.c +++ b/ncurses/widechar/lib_unget_wch.c @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_unget_wch.c,v 1.11 2009/04/04 23:57:25 tom Exp $") +MODULE_ID("$Id: lib_unget_wch.c,v 1.12 2009/10/10 20:01:13 tom Exp $") /* * Wrapper for wcrtomb() which obtains the length needed for the given @@ -86,7 +86,7 @@ NCURSES_SP_NAME(unget_wch) (NCURSES_SP_DCLx const wchar_t wch) wcrtomb(string, wch, &state); for (n = (int) (length - 1); n >= 0; --n) { - if (NCURSES_SP_NAME(ungetch) (NCURSES_SP_ARGx string[n]) != OK) { + if (NCURSES_SP_NAME(ungetch) (NCURSES_SP_ARGx UChar(string[n])) != OK) { result = ERR; break; } diff --git a/progs/tabs.c b/progs/tabs.c index f3cc42fb..aafaa2d8 100644 --- a/progs/tabs.c +++ b/progs/tabs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2008 Free Software Foundation, Inc. * + * Copyright (c) 2008,2009 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 * @@ -37,7 +37,7 @@ #define USE_LIBTINFO #include -MODULE_ID("$Id: tabs.c,v 1.15 2008/11/23 00:47:51 tom Exp $") +MODULE_ID("$Id: tabs.c,v 1.16 2009/10/10 16:15:37 tom Exp $") static void usage(void) GCC_NORETURN; @@ -210,8 +210,8 @@ trimmed_tab_list(const char *source) ; } else { if (last == ',') - result[k++] = last; - result[k++] = ch; + result[k++] = (char) last; + result[k++] = (char) ch; } last = ch; } diff --git a/test/blue.c b/test/blue.c index 84199132..a798c9d5 100644 --- a/test/blue.c +++ b/test/blue.c @@ -40,7 +40,7 @@ * results, use the ncurses(3) library. On non-Intel machines, SVr4 curses is * just as good. * - * $Id: blue.c,v 1.31 2009/08/29 19:02:25 tom Exp $ + * $Id: blue.c,v 1.32 2009/10/10 16:16:46 tom Exp $ */ #include @@ -300,7 +300,7 @@ play_game(void) if (selection[i] != NOCARD) { move(BASEROW + (selection[i] / GRID_WIDTH) * 2 + 3, (selection[i] % GRID_WIDTH) * 5); - (void) printw(" %c ", *lp++ = 'a' + i); + (void) printw(" %c ", (char) (*lp++ = 'a' + i)); } }; *lp = '\0'; @@ -326,7 +326,9 @@ play_game(void) clrtoeol(); (void) addch(' '); } while - (((c = getch()) < 'a' || c > 'd') && (c != 'r') && (c != 'q')); + (((c = (char) getch()) < 'a' || c > 'd') + && (c != 'r') + && (c != 'q')); } for (j = 0; j < 4; j++) diff --git a/test/bs.c b/test/bs.c index fd0780bd..c68d470f 100644 --- a/test/bs.c +++ b/test/bs.c @@ -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.48 2009/08/29 19:02:25 tom Exp $ + * $Id: bs.c,v 1.49 2009/10/10 16:01:41 tom Exp $ */ #include @@ -222,7 +222,7 @@ intro(void) if ((tmpname = getlogin()) != 0) { (void) strcpy(name, tmpname); - name[0] = toupper(UChar(name[0])); + name[0] = (char) toupper(UChar(name[0])); } else (void) strcpy(name, dftname); @@ -440,7 +440,7 @@ initgame(void) /* get a command letter */ prompt(1, "Type one of [%s] to pick a ship.", docked + 1); do { - c = getcoord(PLAYER); + c = (char) getcoord(PLAYER); } while (!strchr(docked, c)); @@ -457,7 +457,7 @@ initgame(void) } do { - c = getch(); + c = (char) getch(); } while (!(strchr("hjklrR", c) || c == FF)); @@ -829,7 +829,7 @@ plyturn(void) break; } hit = IS_SHIP(board[COMPUTER][curx][cury]); - hits[PLAYER][curx][cury] = (hit ? MARK_HIT : MARK_MISS); + hits[PLAYER][curx][cury] = (char) (hit ? MARK_HIT : MARK_MISS); cgoto(cury, curx); #ifdef A_COLOR if (has_colors()) { @@ -952,7 +952,7 @@ cpufire(int x, int y) bool hit, sunk; ship_t *ss = NULL; - hits[COMPUTER][x][y] = (hit = (board[PLAYER][x][y])) ? MARK_HIT : MARK_MISS; + hits[COMPUTER][x][y] = (char) (hit = (board[PLAYER][x][y])) ? MARK_HIT : MARK_MISS; (void) mvprintw(PROMPTLINE, 0, "I shoot at %c%d. I %s!", y + 'A', x, hit ? "hit" : "miss"); diff --git a/test/demo_termcap.c b/test/demo_termcap.c index b36ba96c..4289de05 100644 --- a/test/demo_termcap.c +++ b/test/demo_termcap.c @@ -29,7 +29,7 @@ /* * Author: Thomas E. Dickey * - * $Id: demo_termcap.c,v 1.11 2009/08/02 00:02:53 tom Exp $ + * $Id: demo_termcap.c,v 1.12 2009/10/10 16:01:41 tom Exp $ * * A simple demo of the termcap interface. */ @@ -144,10 +144,10 @@ brute_force(const char *name) cap[2] = 0; for (c1 = 0; c1 < 256; ++c1) { - cap[0] = c1; + cap[0] = (char) c1; if (isCapName(c1)) { for (c2 = 0; c2 < 256; ++c2) { - cap[1] = c2; + cap[1] = (char) c2; if (isCapName(c2)) { dumpit(cap); } diff --git a/test/dots.c b/test/dots.c index 2d647185..57e33413 100644 --- a/test/dots.c +++ b/test/dots.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1999-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1999-2008,2009 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 1999 * - * $Id: dots.c,v 1.17 2008/02/09 18:08:50 tom Exp $ + * $Id: dots.c,v 1.19 2009/10/10 16:22:24 tom Exp $ * * A simple demo of the terminfo interface. */ @@ -49,11 +49,14 @@ static time_t started; static int outc(TPUTS_ARG c) { + int rc = c; + if (interrupted) { - char tmp = c; - write(STDOUT_FILENO, &tmp, 1); + char tmp = (char) c; + if (write(STDOUT_FILENO, &tmp, 1) == -1) + rc = EOF; } else { - putc(c, stdout); + rc = putc(c, stdout); } return 0; } diff --git a/test/dots_mvcur.c b/test/dots_mvcur.c index 775d15c1..611964c1 100644 --- a/test/dots_mvcur.c +++ b/test/dots_mvcur.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2007-2008,2009 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 - 2007 * - * $Id: dots_mvcur.c,v 1.3 2008/02/09 18:08:57 tom Exp $ + * $Id: dots_mvcur.c,v 1.4 2009/10/10 16:14:24 tom Exp $ * * A simple demo of the terminfo interface, and mvcur. */ @@ -49,13 +49,17 @@ static time_t started; static int outc(TPUTS_ARG c) { + int rc = c; + if (interrupted) { - char tmp = c; - write(STDOUT_FILENO, &tmp, 1); + char tmp = (char) c; + if (write(STDOUT_FILENO, &tmp, 1) == -1) + rc = EOF; } else { - putc(c, stdout); + if (putc(c, stdout) == EOF) + rc = EOF; } - return 0; + return rc; } static bool diff --git a/test/hashtest.c b/test/hashtest.c index 6e1b00b5..2e56d73c 100644 --- a/test/hashtest.c +++ b/test/hashtest.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 1998-2008,2009 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 * @@ -30,7 +30,7 @@ * * Generate timing statistics for vertical-motion optimization. * - * $Id: hashtest.c,v 1.29 2008/08/16 17:26:44 tom Exp $ + * $Id: hashtest.c,v 1.30 2009/10/10 16:14:53 tom Exp $ */ #include @@ -140,10 +140,10 @@ run_test(bool optimized GCC_UNUSED) #endif if (reverse_loops) - for (ch = hi; ch >= lo; ch--) + for (ch = (char) hi; ch >= lo; ch--) one_cycle(ch); else - for (ch = lo; ch <= hi; ch++) + for (ch = (char) lo; ch <= hi; ch++) one_cycle(ch); } diff --git a/test/inserts.c b/test/inserts.c index 700c27c1..9c3a89ee 100644 --- a/test/inserts.c +++ b/test/inserts.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: inserts.c,v 1.19 2009/09/12 22:50:03 tom Exp $ + * $Id: inserts.c,v 1.20 2009/10/10 16:01:41 tom Exp $ * * Demonstrate the winsstr() and winsch functions. * Thomas Dickey - 2002/10/19 @@ -314,7 +314,7 @@ test_inserts(int level) beep(); break; } - buffer[length++] = ch; + buffer[length++] = (char) ch; buffer[length] = '\0'; /* put the string in, one character at a time */ diff --git a/test/railroad.c b/test/railroad.c index 72ff8670..696ae73a 100644 --- a/test/railroad.c +++ b/test/railroad.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2000-2007,2008 Free Software Foundation, Inc. * + * Copyright (c) 2000-2008,2009 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 - 2000 * - * $Id: railroad.c,v 1.17 2008/12/07 02:07:41 juergen Exp $ + * $Id: railroad.c,v 1.18 2009/10/10 16:14:42 tom Exp $ * * A simple demo of the termcap interface. */ @@ -59,7 +59,7 @@ static int outc(TPUTS_ARG c) { if (interrupted) { - char tmp = c; + char tmp = (char) c; write(STDOUT_FILENO, &tmp, 1); } else { putc(c, stdout); diff --git a/test/savescreen.c b/test/savescreen.c index 09f328ba..fe8d4e32 100644 --- a/test/savescreen.c +++ b/test/savescreen.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2007 Free Software Foundation, Inc. * + * Copyright (c) 2007,2009 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: savescreen.c,v 1.10 2007/07/21 17:57:37 tom Exp $ + * $Id: savescreen.c,v 1.11 2009/10/10 19:38:21 tom Exp $ * * Demonstrate save/restore functions from the curses library. * Thomas Dickey - 2007/7/14 @@ -34,6 +34,9 @@ #include +#include +#include + #if TIME_WITH_SYS_TIME # include # include @@ -47,6 +50,13 @@ static bool use_init = FALSE; +static int +fexists(const char *name) +{ + struct stat sb; + return (stat(name, &sb) == 0 && (sb.st_mode & S_IFMT) == S_IFREG); +} + static void setup_next(void) { @@ -163,6 +173,14 @@ main(int argc, char *argv[]) } } + files = argv + optind; + last = argc - optind - 1; + + if (replaying) { + while (last >= 0 && !fexists(files[last])) + --last; + } + initscr(); cbreak(); noecho(); @@ -176,8 +194,6 @@ main(int argc, char *argv[]) } } - files = argv + optind; - last = argc - optind - 1; if (replaying) { /* diff --git a/test/savescreen.sh b/test/savescreen.sh index 481d3ff1..e49aa173 100755 --- a/test/savescreen.sh +++ b/test/savescreen.sh @@ -1,6 +1,6 @@ #!/bin/sh ############################################################################## -# Copyright (c) 2007 Free Software Foundation, Inc. # +# Copyright (c) 2007,2009 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 "Software"), # @@ -26,7 +26,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: savescreen.sh,v 1.3 2007/07/14 21:50:26 tom Exp $ +# $Id: savescreen.sh,v 1.4 2009/10/10 17:08:45 tom Exp $ # # Use this script to exercise "savescreen". # It starts by generating a series of temporary-filenames, which are passed @@ -49,6 +49,7 @@ then while test -f $BEGINS do ./savescreen -r $PARAMS + test $? != 0 && break done else echo "No screens were saved" diff --git a/test/test_addchstr.c b/test/test_addchstr.c index 9f8a3491..247a7560 100644 --- a/test/test_addchstr.c +++ b/test/test_addchstr.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_addchstr.c,v 1.4 2009/09/13 00:00:58 tom Exp $ + * $Id: test_addchstr.c,v 1.5 2009/10/10 16:01:41 tom Exp $ * * Demonstrate the waddchstr() and waddch functions. * Thomas Dickey - 2009/9/12 @@ -346,7 +346,7 @@ test_adds(int level) beep(); break; } - buffer[length++] = ch; + buffer[length++] = (char) ch; buffer[length] = '\0'; /* put the string in, one character at a time */ diff --git a/test/test_addstr.c b/test/test_addstr.c index a0029706..d4c0425e 100644 --- a/test/test_addstr.c +++ b/test/test_addstr.c @@ -26,7 +26,7 @@ * authorization. * ****************************************************************************/ /* - * $Id: test_addstr.c,v 1.2 2009/09/12 22:52:29 tom Exp $ + * $Id: test_addstr.c,v 1.3 2009/10/10 16:01:41 tom Exp $ * * Demonstrate the waddstr() and waddch functions. * Thomas Dickey - 2009/9/12 @@ -312,7 +312,7 @@ test_adds(int level) beep(); break; } - buffer[length++] = ch; + buffer[length++] = (char) ch; buffer[length] = '\0'; /* put the string in, one character at a time */