/*
* Author: Thomas E. Dickey
*
- * $Id: demo_termcap.c,v 1.43 2014/08/31 23:11:39 tom Exp $
+ * $Id: demo_termcap.c,v 1.46 2014/10/10 00:35:43 tom Exp $
*
* A simple demo of the termcap interface.
*/
static void
parse_description(const char *input_name)
{
+ static char empty[1];
+
FILE *fp;
struct stat sb;
size_t count_bools = 0;
if ((fp = fopen(input_name, "r")) == 0)
failed("cannot open input-file");
len = fread(my_blob, sizeof(char), (size_t) sb.st_size, fp);
+ my_blob[sb.st_size] = '\0';
fclose(fp);
/*
* known order.
*/
if (count_strs) {
- my_strvalues[count_strs] = "";
+ my_strvalues[count_strs] = empty;
my_strcodes[count_strs++] = &my_blob[j];
} else if (count_nums) {
- my_numvalues[count_nums] = "";
+ my_numvalues[count_nums] = empty;
my_numcodes[count_nums++] = &my_blob[j];
} else {
my_boolcodes[count_bools++] = &my_blob[j];
{
int pass;
size_t count;
- size_t length = 0;
+ size_t length = 1;
char **result = 0;
char *blob = 0;
char *unused = 0;
}
}
-#if NCURSES_XNAMES
+#if HAVE_USE_EXTENDED_NAMES
use_extended_names(x_opt);
#endif