git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] date.c: Fix off by one error in object-header date parsing
@ 2012-07-12 20:50 Junio C Hamano
  0 siblings, 0 replies; only message in thread
From: Junio C Hamano @ 2012-07-12 20:50 UTC (permalink / raw)
  To: git

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>
---
 date.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

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] != '-'))
-- 
1.7.11.2

^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2012-07-12 20:50 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-07-12 20:50 [PATCH] date.c: Fix off by one error in object-header date parsing Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).