Skip to content

Commit be21d16

Browse files
committed
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 <[email protected]>
1 parent cb102b0 commit be21d16

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

date.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -595,7 +595,7 @@ static int match_object_header_date(const char *date, unsigned long *timestamp,
595595
unsigned long stamp;
596596
int ofs;
597597

598-
if (*date < '0' || '9' <= *date)
598+
if (*date < '0' || '9' < *date)
599599
return -1;
600600
stamp = strtoul(date, &end, 10);
601601
if (*end != ' ' || stamp == ULONG_MAX || (end[1] != '+' && end[1] != '-'))

0 commit comments

Comments
 (0)