From 85dfab7eaf1624577ec6de8375fd771ef9b4672a Mon Sep 17 00:00:00 2001 From: Julien Ramseier Date: Tue, 21 Mar 2017 12:30:03 -0400 Subject: [PATCH] fix off-by-one in strptime %j tm_yday range is 0-365 while %j is 1-366 --- src/time/strptime.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/time/strptime.c b/src/time/strptime.c index 55c7ed1b..da9e1f42 100644 --- a/src/time/strptime.c +++ b/src/time/strptime.c @@ -73,6 +73,7 @@ char *strptime(const char *restrict s, const char *restrict f, struct tm *restri dest = &tm->tm_yday; min = 1; range = 366; + adj = 1; goto numeric_range; case 'm': dest = &tm->tm_mon; -- 2.25.1