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 55c7ed1b4bc7f40d2983e4b382c946b6ec77cd0c..da9e1f42c3c932a5dc4ea08b9ac2fa3bc403e2f5 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;