Skip to content

Commit

Permalink
date.c: Fix off by one error in object-header date parsing
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Junio C Hamano committed Jul 12, 2012
1 parent cb102b0 commit be21d16
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion date.c
Original file line number Diff line number Diff line change
Expand Up @@ -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] != '-'))
Expand Down

0 comments on commit be21d16

Please sign in to comment.