]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/tset.c
ncurses 6.0 - patch 20161126
[ncurses.git] / progs / tset.c
index b905ee3c426c2846d902a5dabc115d076b502ad2..f21cb6d731f330948a9703b0c1c543ac33731ec7 100644 (file)
@@ -96,7 +96,7 @@
 char *ttyname(int fd);
 #endif
 
-MODULE_ID("$Id: tset.c,v 1.110 2016/08/27 18:06:47 tom Exp $")
+MODULE_ID("$Id: tset.c,v 1.113 2016/10/22 23:34:47 tom Exp $")
 
 #ifndef environ
 extern char **environ;
@@ -106,6 +106,8 @@ const char *_nc_progname = "tset";
 
 #define LOWERCASE(c) ((isalpha(UChar(c)) && isupper(UChar(c))) ? tolower(UChar(c)) : (c))
 
+static void exit_error(void) GCC_NORETURN;
+
 static int
 CaselessCmp(const char *a, const char *b)
 {                              /* strcasecmp isn't portable */
@@ -152,7 +154,8 @@ failed(const char *msg)
     } else {
        _nc_STRCPY(temp, "tset: ", sizeof(temp));
     }
-    perror(strncat(temp, msg, sizeof(temp) - strlen(temp) - 2));
+    _nc_STRNCAT(temp, msg, sizeof(temp), sizeof(temp) - strlen(temp) - 2);
+    perror(temp);
     exit_error();
     /* NOTREACHED */
 }
@@ -841,7 +844,7 @@ main(int argc, char **argv)
     if (!noset) {
 #if HAVE_SIZECHANGE
        if (opt_w) {
-           set_window_size(my_fd, lines, columns);
+           set_window_size(my_fd, &lines, &columns);
        }
 #endif
        if (opt_c) {