From: Junio C Hamano Date: Thu, 12 Jul 2012 20:46:49 +0000 (-0700) Subject: date.c: Fix off by one error in object-header date parsing X-Git-Tag: v1.7.11.4~7^2~1 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/be21d167b2a819fd2b4991a395e95906b3cb176a?hp=--cc date.c: Fix off by one error in object-header date parsing It is perfectly OK for a valid decimal integer to begin with '9' but 116eb3a (parse_date(): allow ancient git-timestamp, 2012-02-02) did not express the range correctly. Signed-off-by: Junio C Hamano --- be21d167b2a819fd2b4991a395e95906b3cb176a diff --git a/date.c b/date.c index bf8e088e6a..67b3d66f66 100644 --- a/date.c +++ b/date.c @@ -595,7 +595,7 @@ static int match_object_header_date(const char *date, unsigned long *timestamp, unsigned long stamp; int ofs; - if (*date < '0' || '9' <= *date) + if (*date < '0' || '9' < *date) return -1; stamp = strtoul(date, &end, 10); if (*end != ' ' || stamp == ULONG_MAX || (end[1] != '+' && end[1] != '-'))