#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_color.c,v 1.137 2018/03/01 15:02:12 tom Exp $")
+MODULE_ID("$Id: lib_color.c,v 1.138 2018/05/16 08:24:08 tom Exp $")
#ifdef USE_TERM_DRIVER
#define CanChange InfoOf(SP_PARM).canchange
if (!ValidPair(sp, pair)) {
result = ERR;
} else {
- int fg = FORE_OF(sp->_color_pairs[pair]);
- int bg = BACK_OF(sp->_color_pairs[pair]);
+ int fg;
+ int bg;
+ _nc_reserve_pairs(sp, pair);
+ fg = FORE_OF(sp->_color_pairs[pair]);
+ bg = BACK_OF(sp->_color_pairs[pair]);
#if NCURSES_EXT_FUNCS
if (isDefaultColor(fg))
fg = -1;