summaryrefslogtreecommitdiff
path: root/color.c
diff options
context:
space:
mode:
authorTimo Hirvonen <tihirvon@gmail.com>2008-02-06 14:16:08 +0200
committerJunio C Hamano <gitster@pobox.com>2008-02-06 14:02:41 -0800
commita0cf49c16ae37177dcfcefa1149bf09f84721cf5 (patch)
treecac86ec1c7498c185638dbe979406ff05bce32cf /color.c
parentf1c3239ab5c4d66637822b03db407f87ed068d15 (diff)
downloadgit-a0cf49c16ae37177dcfcefa1149bf09f84721cf5.tar.gz
Fix parsing numeric color values
Numeric color only worked if it was at end of line. Noticed by Chris Larson <clarson@kergoth.com>. Signed-off-by: Timo Hirvonen <tihirvon@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'color.c')
-rw-r--r--color.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/color.c b/color.c
index 7f66c29fae..cb70340420 100644
--- a/color.c
+++ b/color.c
@@ -17,7 +17,7 @@ static int parse_color(const char *name, int len)
return i - 1;
}
i = strtol(name, &end, 10);
- if (*name && !*end && i >= -1 && i <= 255)
+ if (end - name == len && i >= -1 && i <= 255)
return i;
return -2;
}