From: Vincent Lefevre Date: Sat, 29 Dec 2018 19:08:26 +0000 (+0100) Subject: Light colors: do not do the + 8 on negative values, such as COLOR_DEFAULT X-Git-Tag: 2019-10-25~396^2~9 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=d9d358d0800cb47e64cf7e74b4f461a789a45d46;p=neomutt Light colors: do not do the + 8 on negative values, such as COLOR_DEFAULT Co-authored-by: Richard Russon --- diff --git a/color.c b/color.c index b9b7382bc..e505963fa 100644 --- a/color.c +++ b/color.c @@ -499,7 +499,7 @@ static int parse_color_name(const char *s, int *col, int *attr, bool is_fg, stru { if ((COLORS >= 16) && is_light) { - if (*col < 8) + if ((*col >= 0) && (*col <= 7)) { /* Advance the color 0-7 by 8 to get the light version */ *col += 8; @@ -514,7 +514,7 @@ static int parse_color_name(const char *s, int *col, int *attr, bool is_fg, stru { if (COLORS >= 16) { - if (*col < 8) + if ((*col >= 0) && (*col <= 7)) { /* Advance the color 0-7 by 8 to get the light version */ *col += 8;