]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/tset.c
ncurses 6.0 - patch 20160910
[ncurses.git] / progs / tset.c
index b905ee3c426c2846d902a5dabc115d076b502ad2..8b96838e3fa04d83820d818c5d01803126db2b01 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.112 2016/09/10 23:33:10 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 */
 }