1
0
Эх сурвалжийг харах

fix strftime %y for negative tm_year

Szabolcs Nagy 8 жил өмнө
parent
commit
583ea83541

+ 1 - 0
src/time/strftime.c

@@ -167,6 +167,7 @@ const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm *
 		goto nl_strftime;
 		goto nl_strftime;
 	case 'y':
 	case 'y':
 		val = tm->tm_year % 100;
 		val = tm->tm_year % 100;
+		if (val<0) val += 100;
 		goto number;
 		goto number;
 	case 'Y':
 	case 'Y':
 		val = tm->tm_year + 1900LL;
 		val = tm->tm_year + 1900LL;