date and time created 88/12/22 13:04:38 by sam
[unix-history] / usr / src / lib / libcurses / setterm.c
index 2ff70d5..4e26719 100644 (file)
@@ -1,7 +1,27 @@
+/*
+ * Copyright (c) 1981 Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms are permitted
+ * provided that the above copyright notice and this paragraph are
+ * duplicated in all such forms and that any documentation,
+ * advertising materials, and other materials related to such
+ * distribution and use acknowledge that the software was developed
+ * by the University of California, Berkeley.  The name of the
+ * University may not be used to endorse or promote products derived
+ * from this software without specific prior written permission.
+ * THIS SOFTWARE IS PROVIDED ``AS IS'' AND WITHOUT ANY EXPRESS OR
+ * IMPLIED WARRANTIES, INCLUDING, WITHOUT LIMITATION, THE IMPLIED
+ * WARRANTIES OF MERCHANTIBILITY AND FITNESS FOR A PARTICULAR PURPOSE.
+ */
+
+#ifndef lint
+static char sccsid[] = "@(#)setterm.c  5.4 (Berkeley) %G%";
+#endif /* not lint */
+
 /*
  * Terminal initialization routines.
  *
 /*
  * Terminal initialization routines.
  *
- * @(#)setterm.c       1.17 (Berkeley) %G%
  */
 
 # include      "curses.ext"
  */
 
 # include      "curses.ext"
@@ -125,7 +145,8 @@ reg char    *type; {
 
        PC = _PC ? _PC[0] : FALSE;
        aoftspace = _tspace;
 
        PC = _PC ? _PC[0] : FALSE;
        aoftspace = _tspace;
-       strcpy(ttytype, longname(genbuf, type));
+       strncpy(ttytype, longname(genbuf, type), sizeof(ttytype) - 1);
+       ttytype[sizeof(ttytype) - 1] = '\0';
        if (unknown)
                return ERR;
        return OK;
        if (unknown)
                return ERR;
        return OK;