fix off-by-one in strptime %j
authorJulien Ramseier <j.ramseier@gmail.com>
Tue, 21 Mar 2017 16:30:03 +0000 (12:30 -0400)
committerRich Felker <dalias@aerifal.cx>
Tue, 21 Mar 2017 16:30:03 +0000 (12:30 -0400)
tm_yday range is 0-365 while %j is 1-366

src/time/strptime.c

index 55c7ed1..da9e1f4 100644 (file)
@@ -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;