diff options
| author | Thomas Munro <tmunro@postgresql.org> | 2025-11-20 10:23:44 +1300 |
|---|---|---|
| committer | Thomas Munro <tmunro@postgresql.org> | 2025-11-20 10:38:15 +1300 |
| commit | 6b46669883fac9521c20fe4e2c55ccfbee778591 (patch) | |
| tree | 9d2bb9c0472c3c8c4e5ced5387e736950c4241a6 /src/port/snprintf.c | |
| parent | 7ab9b34614c2d6f69070a667787e0b091ecb72b1 (diff) | |
Drop support for MSVCRT's float formatting quirk.
Commit f1885386 added code to remove an unnecessary leading zero from
the exponent in a float formatted by the system snprintf(). The C
standard doesn't allow unnecessary digits beyond two, and the tests pass
without this on Windows' modern UCRT (required since commit 1758d424).
Discussion: https://postgr.es/m/CA%2BhUKGJnmzTqiODmTjf-23yZ%3DE3HXqFTtKoyp3TF-MpB93hTMQ%40mail.gmail.com
Diffstat (limited to 'src/port/snprintf.c')
| -rw-r--r-- | src/port/snprintf.c | 27 |
1 files changed, 0 insertions, 27 deletions
diff --git a/src/port/snprintf.c b/src/port/snprintf.c index dded6c3f65b..6541182df6d 100644 --- a/src/port/snprintf.c +++ b/src/port/snprintf.c @@ -1205,22 +1205,6 @@ fmtfloat(double value, char type, int forcesign, int leftjust, } if (vallen < 0) goto fail; - - /* - * Windows, alone among our supported platforms, likes to emit - * three-digit exponent fields even when two digits would do. Hack - * such results to look like the way everyone else does it. - */ -#ifdef WIN32 - if (vallen >= 6 && - convert[vallen - 5] == 'e' && - convert[vallen - 3] == '0') - { - convert[vallen - 3] = convert[vallen - 2]; - convert[vallen - 2] = convert[vallen - 1]; - vallen--; - } -#endif } padlen = compute_padlen(minlen, vallen + zeropadlen, leftjust); @@ -1336,17 +1320,6 @@ pg_strfromd(char *str, size_t count, int precision, double value) target.failed = true; goto fail; } - -#ifdef WIN32 - if (vallen >= 6 && - convert[vallen - 5] == 'e' && - convert[vallen - 3] == '0') - { - convert[vallen - 3] = convert[vallen - 2]; - convert[vallen - 2] = convert[vallen - 1]; - vallen--; - } -#endif } } |
