libc: only elide fractional parts in g/G, not f/F

This commit is contained in:
K. Lange 2021-07-13 19:21:51 +09:00
parent b4f4edb614
commit 607b64ada2

View File

@ -317,7 +317,7 @@ size_t xvasprintf(int (*callback)(void *, char), void * userData, const char * f
OUT('n');
}
break;
} else if (exponent == 0 && fraction == 0) {
} else if ((*f == 'g' || *f == 'G') && exponent == 0 && fraction == 0) {
if (SIGNBIT(asBits)) {
OUT('-');
}