summaryrefslogtreecommitdiff
path: root/date.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2012-07-12 20:46:49 (GMT)
committerJunio C Hamano <gitster@pobox.com>2012-07-12 20:49:41 (GMT)
commitbe21d167b2a819fd2b4991a395e95906b3cb176a (patch)
treed091446ca8a45ecc27a1967082c7d87776d078e1 /date.c
parentcb102b083252b575b18afa8d4b4a4b1bc1ffdf9e (diff)
downloadgit-be21d167b2a819fd2b4991a395e95906b3cb176a.zip
git-be21d167b2a819fd2b4991a395e95906b3cb176a.tar.gz
git-be21d167b2a819fd2b4991a395e95906b3cb176a.tar.bz2
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 <gitster@pobox.com>
Diffstat (limited to 'date.c')
-rw-r--r--date.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/date.c b/date.c
index bf8e088..67b3d66 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] != '-'))