From df04a0c8fb020773e4708d00ee061e8f7a0501b9 Mon Sep 17 00:00:00 2001 From: Ulf Magnusson Date: Fri, 7 Sep 2018 23:34:43 +0200 Subject: menuconfig: Fix off-by-one in range check for COLORS "color values are expected to be in the range 0 to COLORS-1", from init_color(3ncurses). --- menuconfig.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/menuconfig.py b/menuconfig.py index f69af58..50c32a5 100755 --- a/menuconfig.py +++ b/menuconfig.py @@ -335,10 +335,10 @@ def _style_to_curses(cstr): "A color must either be predefined or a number. " \ "Error near: {}".format(t)) - if not -1 <= cnum <= curses.COLORS: + if not -1 <= cnum < curses.COLORS: raise StyleError( - "Fixed color must be in range -1..{}. " \ - "Error near: {}".format(curses.COLORS - 1, t)) + "Fixed color must be in range -1..curses.COLORS-1 " + "(-1..{}). Error near: {}".format(curses.COLORS - 1, t)) return cnum -- cgit v1.2.3