]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/demo_terminfo.c
ncurses 5.9 - patch 20120804
[ncurses.git] / test / demo_terminfo.c
index ebca898a80b2f7d10f31b95b1b83f60e347a5a5e..8b64869f1c2aae4e35e3540a5a7ae36abc475f3e 100644 (file)
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: demo_terminfo.c,v 1.11 2012/06/22 23:04:03 tom Exp $
+ * $Id: demo_terminfo.c,v 1.13 2012/07/07 23:37:13 tom Exp $
  *
  * A simple demo of the terminfo interface.
  */
@@ -69,8 +69,8 @@ static long total_values;
 static char *
 make_dbitem(char *p, char *q)
 {
-    char *result = malloc(strlen(e_opt) + 2 + p - q);
-    sprintf(result, "%s=%.*s", e_opt, p - q, q);
+    char *result = malloc(strlen(e_opt) + 2 + (size_t) (p - q));
+    sprintf(result, "%s=%.*s", e_opt, (int) (p - q), q);
     return result;
 }