Skip to content

Commit f19bc59

Browse files
committed
wchgat() failed to mask out colors from 'attr'. So you could get a weird mix of colors from that and colors specified via the 'color' parameter. Fixes issue #359.
1 parent 993542b commit f19bc59

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

pdcurses/attr.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ int wchgat(WINDOW *win, int n, attr_t attr, short color, const void *opts)
358358
if (!win)
359359
return ERR;
360360

361-
newattr = (attr & A_ATTRIBUTES) | COLOR_PAIR(integer_color_pair);
361+
newattr = (attr & (A_ATTRIBUTES & ~A_COLOR)) | COLOR_PAIR(integer_color_pair);
362362

363363
startpos = win->_curx;
364364
endpos = ((n < 0) ? win->_maxx : min(startpos + n, win->_maxx)) - 1;

0 commit comments

Comments
 (0)