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/stdio/vfprintf.c
diff options
context:
space:
mode:
authorRich Felker <dalias@aerifal.cx>2012年04月16日 21:50:23 -0400
committerRich Felker <dalias@aerifal.cx>2012年04月16日 21:50:23 -0400
commitcc3a4466605fe8dfc31f3b75779110ac93055bc1 (patch)
tree6536cfee1d6d361f66b2975888b50024a437e426 /src/stdio/vfprintf.c
parent9d2a15a64e03b2e369161add728de3139dae5a7f (diff)
downloadmusl-cc3a4466605fe8dfc31f3b75779110ac93055bc1.tar.gz
fix %lf, etc. with printf
the l prefix is redundant/no-op with printf, since default promotions always promote floats to double; however, it is valid, and printf was wrongly rejecting it.
Diffstat (limited to 'src/stdio/vfprintf.c')
-rw-r--r--src/stdio/vfprintf.c 2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c
index b5001ff2..928c8c16 100644
--- a/src/stdio/vfprintf.c
+++ b/src/stdio/vfprintf.c
@@ -73,6 +73,8 @@ static const unsigned char states[]['z'-'A'+1] = {
}, { /* 1: l-prefixed */
S('d') = LONG, S('i') = LONG,
S('o') = ULONG, S('u') = ULONG, S('x') = ULONG, S('X') = ULONG,
+ S('e') = DBL, S('f') = DBL, S('g') = DBL, S('a') = DBL,
+ S('E') = DBL, S('F') = DBL, S('G') = DBL, S('A') = DBL,
S('c') = INT, S('s') = PTR, S('n') = PTR,
S('l') = LLPRE,
}, { /* 2: ll-prefixed */
generated by cgit v1.2.1 (git 2.18.0) at 2025年10月01日 17:22:21 +0000

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