From d9d358d0800cb47e64cf7e74b4f461a789a45d46 Mon Sep 17 00:00:00 2001 From: Vincent Lefevre Date: Sat, 29 Dec 2018 20:08:26 +0100 Subject: [PATCH] Light colors: do not do the + 8 on negative values, such as COLOR_DEFAULT Co-authored-by: Richard Russon --- color.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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; -- 2.50.1