]> granicus.if.org Git - nethack/commitdiff
Fix segfault when MD termcap is not defined
authorPasi Kallinen <paxed@alt.org>
Mon, 2 Mar 2015 18:21:34 +0000 (20:21 +0200)
committerPasi Kallinen <paxed@alt.org>
Mon, 2 Mar 2015 18:21:34 +0000 (20:21 +0200)
win/tty/termcap.c

index 563491c4833e8eb3f1933066fa1c718d6a3663d8..b06a9abfe1afc6004dd5cdf5eb3f24fc96a83a9a 100644 (file)
@@ -847,6 +847,7 @@ init_hilite()
        hilites[CLR_GRAY] = hilites[NO_COLOR] = (char *)0;
 
        if (tgetnum("Co") < 8
+           || (MD == NULL) || (strlen(MD) == 0)
            || ((setf = tgetstr("AF", (char **)0)) == (char *)0
                 && (setf = tgetstr("Sf", (char **)0)) == (char *)0))
                return;