Hi,
The test "if (zeropadlen > 0)" is redundant and can be salely removed.
It has already been tested in the same path.

Best regards,
Ranier Vilela

--- \dll\postgresql\a\port\snprintf.c   2019-11-23 13:19:20.000000000 -0300
+++ snprintf.c  2019-11-24 13:02:45.510806400 -0300
@@ -1227,16 +1227,14 @@
                {
                        /* pad before exponent */
                        dostr(convert, epos - convert, target);
-                       if (zeropadlen > 0)
-                               dopr_outchmulti('0', zeropadlen, target);
+                       dopr_outchmulti('0', zeropadlen, target);
                        dostr(epos, vallen - (epos - convert), target);
                }
                else
                {
                        /* no exponent, pad after the digits */
                        dostr(convert, vallen, target);
-                       if (zeropadlen > 0)
-                               dopr_outchmulti('0', zeropadlen, target);
+                       dopr_outchmulti('0', zeropadlen, target);
                }
        }
        else

Attachment: snprintf.c.patch
Description: snprintf.c.patch

Reply via email to