]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - progs/tset.c
ncurses 5.9 - patch 20121229
[ncurses.git] / progs / tset.c
index 7a5c5b8a2704221d7fe4696e63a413697bbb9a55..f7f00c5ef94c397308c7dc0cbdc92a245d56ad06 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2011,2012 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            *
@@ -119,7 +119,7 @@ char *ttyname(int fd);
 #include <dump_entry.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tset.c,v 1.86 2012/01/07 20:23:20 juergen Exp $")
+MODULE_ID("$Id: tset.c,v 1.90 2012/12/15 23:01:17 tom Exp $")
 
 /*
  * SCO defines TIOCGSIZE and the corresponding struct.  Other systems (SunOS,
@@ -213,10 +213,10 @@ failed(const char *msg)
     size_t len = strlen(_nc_progname) + 2;
 
     if ((int) len < (int) sizeof(temp) - 12) {
-       strcpy(temp, _nc_progname);
-       strcat(temp, ": ");
+       _nc_STRCPY(temp, _nc_progname, sizeof(temp));
+       _nc_STRCAT(temp, ": ", sizeof(temp));
     } else {
-       strcpy(temp, "tset: ");
+       _nc_STRCPY(temp, "tset: ", sizeof(temp));
     }
     perror(strncat(temp, msg, sizeof(temp) - strlen(temp) - 2));
     exit_error();
@@ -474,9 +474,6 @@ add_mapping(const char *port, char *arg)
        mapp->speed = tbaudrate(p);
     }
 
-    if (arg == (char *) 0)     /* Non-optional type. */
-       goto badmopt;
-
     mapp->type = arg;
 
     /* Terminate porttype, if specified. */