summaryrefslogtreecommitdiff
path: root/src/time/strftime.c
diff options
context:
space:
mode:
authorSzabolcs Nagy <nsz@port70.net>2016-10-04 17:14:57 +0000
committerRich Felker <dalias@aerifal.cx>2016-10-06 18:41:45 -0400
commit583ea83541dcc6481c7a1bd1a9b485526bad84a1 (patch)
tree66dce9c91f03428fba706af01163e43ac86e0257 /src/time/strftime.c
parent8d7a3f40c8de414122eb8eb2131291782ee8ed15 (diff)
downloadmusl-583ea83541dcc6481c7a1bd1a9b485526bad84a1.tar.gz
fix strftime %y for negative tm_year
Diffstat (limited to 'src/time/strftime.c')
-rw-r--r--src/time/strftime.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/time/strftime.c b/src/time/strftime.c
index f1ccc4dd..e103e02b 100644
--- a/src/time/strftime.c
+++ b/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;
case 'y':
val = tm->tm_year % 100;
+ if (val<0) val += 100;
goto number;
case 'Y':
val = tm->tm_year + 1900LL;