X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=progs%2Ftset.c;h=8b96838e3fa04d83820d818c5d01803126db2b01;hp=b905ee3c426c2846d902a5dabc115d076b502ad2;hb=e2e9c09c48b19b24979cafb2d4864f538b5ddd1c;hpb=bdb754b9f04f332b59d72f761a297497b2db8af1 diff --git a/progs/tset.c b/progs/tset.c index b905ee3c..8b96838e 100644 --- a/progs/tset.c +++ b/progs/tset.c @@ -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 */ }