avoid raising spurious division-by-zero exception in printf

This commit is contained in:
Rich Felker 2012-10-18 20:26:41 -04:00
parent f321de9e0a
commit 776251867d
1 changed files with 1 additions and 1 deletions

View File

@ -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;