/*
* Author: Thomas E. Dickey
*
- * $Id: demo_termcap.c,v 1.20 2012/06/22 22:37:05 tom Exp $
+ * $Id: demo_termcap.c,v 1.22 2012/07/07 23:37:27 tom Exp $
*
* A simple demo of the termcap interface.
*/
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;
}