]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/demo_terminfo.c
ncurses 5.9 - patch 20121229
[ncurses.git] / test / demo_terminfo.c
index 8b64869f1c2aae4e35e3540a5a7ae36abc475f3e..d9bf5540b60f0c9df221debfe737b76d55f982ee 100644 (file)
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: demo_terminfo.c,v 1.13 2012/07/07 23:37:13 tom Exp $
+ * $Id: demo_terminfo.c,v 1.15 2012/12/29 23:36:22 tom Exp $
  *
  * A simple demo of the terminfo interface.
  */
@@ -283,7 +283,7 @@ demo_terminfo(char *name)
            }
 #endif
        } else {
-           char temp[10];
+           char temp[80];
            static const char *xterm_keys[] =
            {
                "kDC", "kDN", "kEND", "kHOM", "kIC",
@@ -292,9 +292,9 @@ demo_terminfo(char *name)
            for (n = 0; n < SIZEOF(xterm_keys); ++n) {
                for (mod = 0; mod < 8; ++mod) {
                    if (mod == 0)
-                       strcpy(temp, xterm_keys[n]);
+                       sprintf(temp, "%.*s", 8, xterm_keys[n]);
                    else
-                       sprintf(temp, "%s%d", xterm_keys[n], mod);
+                       sprintf(temp, "%.*s%d", 8, xterm_keys[n], mod);
                    dumpit(temp);
                }
            }