diff --git a/src/curses/window.cpp b/src/curses/window.cpp index 93ca3a87..41f1649f 100644 --- a/src/curses/window.cpp +++ b/src/curses/window.cpp @@ -217,9 +217,9 @@ int Color::pairNumber() const else if (!isDefault()) { if (!previousBackground()) - result = background() + 1; + result = (background() + 1) % COLORS; result *= 256; - result += foreground(); + result += foreground() % COLORS; assert(result < int(color_pair_map.size()));