X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=progs%2Fdump_entry.c;h=8a47084a28bf9ba91735578c45cf6ef8dfda955c;hp=d0e420ecfb453c6410d2d1f67ebbd33a9a36f5a4;hb=c55d387cebf1cee4757ca2c2ef4fbeae59ee4175;hpb=b116355ab2af379e49fd0be31bdd440fc14fd902 diff --git a/progs/dump_entry.c b/progs/dump_entry.c index d0e420ec..8a47084a 100644 --- a/progs/dump_entry.c +++ b/progs/dump_entry.c @@ -39,7 +39,7 @@ #include "termsort.c" /* this C file is generated */ #include /* so is this */ -MODULE_ID("$Id: dump_entry.c,v 1.173 2019/05/11 21:02:24 tom Exp $") +MODULE_ID("$Id: dump_entry.c,v 1.175 2019/10/12 15:59:07 tom Exp $") #define DISCARD(string) string = ABSENT_STRING #define PRINTF (void) printf @@ -1136,7 +1136,8 @@ fmt_entry(TERMTYPE2 *tterm, *d++ = '\\'; *d = ':'; } else if (*d == '\\') { - *++d = *s++; + if ((*++d = *s++) == '\0') + break; } d++; *d = '\0'; @@ -1396,7 +1397,7 @@ one_one_mapping(const char *mapping) if (VALID_STRING(mapping)) { int n = 0; - while (mapping[n] != '\0') { + while (mapping[n] != '\0' && mapping[n + 1] != '\0') { if (isLine(mapping[n]) && mapping[n] != mapping[n + 1]) { result = FALSE;