036-fix-strftime-y-for-negative-tm_year.patch 657 B

1234567891011121314151617181920212223
  1. From 583ea83541dcc6481c7a1bd1a9b485526bad84a1 Mon Sep 17 00:00:00 2001
  2. From: Szabolcs Nagy <[email protected]>
  3. Date: Tue, 4 Oct 2016 17:14:57 +0000
  4. Subject: fix strftime %y for negative tm_year
  5. ---
  6. src/time/strftime.c | 1 +
  7. 1 file changed, 1 insertion(+)
  8. diff --git a/src/time/strftime.c b/src/time/strftime.c
  9. index f1ccc4d..e103e02 100644
  10. --- a/src/time/strftime.c
  11. +++ b/src/time/strftime.c
  12. @@ -167,6 +167,7 @@ const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm *
  13. goto nl_strftime;
  14. case 'y':
  15. val = tm->tm_year % 100;
  16. + if (val<0) val += 100;
  17. goto number;
  18. case 'Y':
  19. val = tm->tm_year + 1900LL;
  20. --
  21. cgit v0.11.2