From d018703d17dec5b7d0fab80eaef82edc73b29d1c Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Fri, 9 Jun 2000 17:42:14 +0000 Subject: [PATCH] Force decimal parsing on dates, so 09 is parsed as 9, and not as "invalid". --- pattern.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/pattern.c b/pattern.c index 4b749ab2..182ed633 100644 --- a/pattern.c +++ b/pattern.c @@ -331,7 +331,7 @@ static const char *getDate (const char *s, struct tm *t, BUFFER *err) time_t now = time (NULL); struct tm *tm = localtime (&now); - t->tm_mday = strtol (s, &p, 0); + t->tm_mday = strtol (s, &p, 10); if (t->tm_mday < 1 || t->tm_mday > 31) { snprintf (err->data, err->dsize, _("Invalid day of month: %s"), s); @@ -345,7 +345,7 @@ static const char *getDate (const char *s, struct tm *t, BUFFER *err) return p; } p++; - t->tm_mon = strtol (p, &p, 0) - 1; + t->tm_mon = strtol (p, &p, 10) - 1; if (t->tm_mon < 0 || t->tm_mon > 11) { snprintf (err->data, err->dsize, _("Invalid month: %s"), p); @@ -357,7 +357,7 @@ static const char *getDate (const char *s, struct tm *t, BUFFER *err) return p; } p++; - t->tm_year = strtol (p, &p, 0); + t->tm_year = strtol (p, &p, 10); if (t->tm_year < 70) /* year 2000+ */ t->tm_year += 100; else if (t->tm_year > 1900) -- 2.40.0