X-Git-Url: http://ncurses.scripts.mit.edu/?a=blobdiff_plain;f=progs%2Ftic.c;h=1175d9a479a921aa4376a0fd775ad36a1880504d;hb=21c8ffa0edf2e389f3f674f0c08009002c6f357d;hp=8182e2eea7aa9d8a0f2c1d4682bfac67c5d1dbe0;hpb=fe7c48d7d5115212f09b4ec0d84b189a76953f0d;p=ncurses.git diff --git a/progs/tic.c b/progs/tic.c index 8182e2ee..1175d9a4 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -48,7 +48,7 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.210 2015/05/27 00:58:18 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.213 2015/08/22 23:49:57 tom Exp $") #define STDIN_NAME "" @@ -142,6 +142,7 @@ usage(void) static const char options_string[] = { DATA("Options:") + DATA(" -0 format translation output all capabilities on one line") DATA(" -1 format translation output one capability per line") #if NCURSES_XNAMES DATA(" -a retain commented-out capabilities (sets -x also)") @@ -2149,7 +2150,7 @@ get_fkey_list(TERMTYPE *tp) NAME_VALUE *result = typeMalloc(NAME_VALUE, NUM_STRINGS(tp) + 1); const struct tinfo_fkeys *all_fkeys = _nc_tinfo_fkeys; int used = 0; - int j; + unsigned j; if (result == 0) failed("get_fkey_list"); @@ -2165,7 +2166,7 @@ get_fkey_list(TERMTYPE *tp) } #if NCURSES_XNAMES for (j = STRCOUNT; j < NUM_STRINGS(tp); ++j) { - const char *name = ExtStrname(tp, j, strnames); + const char *name = ExtStrname(tp, (int) j, strnames); if (*name == 'k') { result[used].keycode = -1; result[used].name = name; @@ -2337,13 +2338,15 @@ check_termtype(TERMTYPE *tp, bool literal) ("will trim sgr0\n\toriginal sgr0=%s\n\ttrimmed sgr0=%s", _nc_visbuf2(1, exit_attribute_mode), _nc_visbuf2(2, check_sgr0))); - free(check_sgr0); } else { DEBUG(2, ("will not trim sgr0\n\toriginal sgr0=%s", _nc_visbuf(exit_attribute_mode))); } } + if (check_sgr0 != exit_attribute_mode) { + free(check_sgr0); + } } #ifdef TRACE show_where(2);