]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_color.c
ncurses 6.1 - patch 20180519
[ncurses.git] / ncurses / base / lib_color.c
index 41496eed612994b62c85a2d766ed4741b9f46af3..409b66cab6a06a1e98558a95e600a693c2c41d9f 100644 (file)
@@ -48,7 +48,7 @@
 #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
@@ -938,9 +938,12 @@ _nc_pair_content(SCREEN *sp, int pair, int *f, int *b)
     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;