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年10月18日 20:26:41 -0400
committerRich Felker <dalias@aerifal.cx>2012年10月18日 20:26:41 -0400
commit776251867d07cca2866908186ef245f72596ce75 (patch)
tree35f220753acfa5808691dca7e4d519ac1b1a0659 /src/stdio/vfprintf.c
parentf321de9e0ae130e21faab5afe109270ec913602d (diff)
downloadmusl-776251867d07cca2866908186ef245f72596ce75.tar.gz
avoid raising spurious division-by-zero exception in printf
Diffstat (limited to 'src/stdio/vfprintf.c')
-rw-r--r--src/stdio/vfprintf.c 2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stdio/vfprintf.c b/src/stdio/vfprintf.c
index 6525938f..4a2752b2 100644
--- a/src/stdio/vfprintf.c
+++ b/src/stdio/vfprintf.c
@@ -200,7 +200,7 @@ static int fmt_fp(FILE *f, long double y, int w, int p, int fl, int t)
char ebuf0[3*sizeof(int)], *ebuf=&ebuf0[3*sizeof(int)], *estr;
pl=1;
- if (y<0 || 1/y<0) {
+ if (signbit(y)) {
y=-y;
} else if (fl & MARK_POS) {
prefix+=3;
generated by cgit v1.2.1 (git 2.18.0) at 2025年09月29日 10:53:54 +0000

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