From af4df00d3eff5502b0eb7c25a55ef48d87d8a5fc Mon Sep 17 00:00:00 2001 From: ache Date: Tue, 2 Sep 1997 19:07:50 +0000 Subject: Fix possible coredump on BW displays --- lib/libncurses/lib_vidattr.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'lib/libncurses') diff --git a/lib/libncurses/lib_vidattr.c b/lib/libncurses/lib_vidattr.c index c8b62e7..0bb5675 100644 --- a/lib/libncurses/lib_vidattr.c +++ b/lib/libncurses/lib_vidattr.c @@ -49,8 +49,12 @@ static void do_color(int pair, int (*outc)(int)) int fg, bg; if ( pair == 0 ) { - tputs(orig_pair, 1, outc); - } else { + if (orig_pair) { + tputs(orig_pair, 1, outc); + } + } else if ((set_a_foreground || set_foreground) && + (set_a_background || set_background) + ) { fg = FG(color_pairs[pair]); bg = BG(color_pairs[pair]); -- cgit v1.1