- if (SP != 0 && SP->_slk != 0 &&
- color_pair_number >= 0 && color_pair_number < COLOR_PAIRS) {
- T(("... current %ld", (long) PAIR_NUMBER(SP->_slk->attr)));
- toggle_attr_on(SP->_slk->attr, COLOR_PAIR(color_pair_number));
- returnCode(OK);
- } else
- returnCode(ERR);
+ if (SP != 0
+ && SP->_slk != 0
+ && color_pair_number >= 0
+ && color_pair_number < SP->_pair_limit) {
+ TR(TRACE_ATTRS, ("... current is %s", _tracech_t(CHREF(SP->_slk->attr))));
+ SetPair(SP->_slk->attr, color_pair_number);
+ TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP->_slk->attr))));
+ code = OK;
+ }
+ returnCode(code);