]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/reset_cmd.c
ncurses 6.0 - patch 20161001
[ncurses.git] / progs / reset_cmd.c
index da953eb1218804ed4d8850fa0d61c058dbb5047c..09dba5e5bb8bad1a4699c460e94b0c45c408450f 100644 (file)
@@ -51,7 +51,7 @@
 #include <sys/ptem.h>
 #endif
 
-MODULE_ID("$Id: reset_cmd.c,v 1.6 2016/08/20 23:53:44 tom Exp $")
+MODULE_ID("$Id: reset_cmd.c,v 1.7 2016/09/10 20:49:10 tom Exp $")
 
 /*
  * SCO defines TIOCGSIZE and the corresponding struct.  Other systems (SunOS,
@@ -98,7 +98,8 @@ failed(const char *msg)
 
     _nc_STRCPY(temp, _nc_progname, sizeof(temp));
     _nc_STRCAT(temp, ": ", 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 */
 }