Explorar o código

fix off-by-one in strptime %j

tm_yday range is 0-365 while %j is 1-366
Julien Ramseier %!s(int64=8) %!d(string=hai) anos
pai
achega
85dfab7eaf
Modificáronse 1 ficheiros con 1 adicións e 0 borrados
  1. 1 0
      src/time/strptime.c

+ 1 - 0
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;