musl - musl - an implementation of the standard library for Linux-based systems

index : musl
musl - an implementation of the standard library for Linux-based systems
summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/time/strftime.c 4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/time/strftime.c b/src/time/strftime.c
index e103e02b..a3039204 100644
--- a/src/time/strftime.c
+++ b/src/time/strftime.c
@@ -166,8 +166,8 @@ const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm *
item = T_FMT;
goto nl_strftime;
case 'y':
- val = tm->tm_year % 100;
- if (val<0) val += 100;
+ val = (tm->tm_year + 1900LL) % 100;
+ if (val < 0) val = -val;
goto number;
case 'Y':
val = tm->tm_year + 1900LL;
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月17日 07:52:43 +0000

AltStyle によって変換されたページ (->オリジナル) /