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:
authorRich Felker <dalias@aerifal.cx>2013年08月24日 14:35:17 -0400
committerRich Felker <dalias@aerifal.cx>2013年08月24日 14:35:17 -0400
commit2828a130b1e822414a13961680245d04f2989a4b (patch)
treef290121684830f05be377ecf39e68d9004b02c97 /src
parent190bbb992344e350925bb9ebc37775ba8cc4c19f (diff)
downloadmusl-2828a130b1e822414a13961680245d04f2989a4b.tar.gz
fix strftime regression in %e format
%e pads with spaces instead of zeros.
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 48f65320..4039d744 100644
--- a/src/time/strftime.c
+++ b/src/time/strftime.c
@@ -80,8 +80,8 @@ const char *__strftime_fmt_1(char (*s)[100], size_t *l, int f, const struct tm *
fmt = "%m/%d/%y";
goto recu_strftime;
case 'e':
- val = tm->tm_mday;
- goto number;
+ *l = snprintf(*s, sizeof *s, "%2d", tm->tm_mday);
+ return *s;
case 'F':
fmt = "%Y-%m-%d";
goto recu_strftime;
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月20日 02:17:03 +0000

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