]> gitweb.michael.orlitzky.com - postfix-logwatch.git/commit
Fix redundant argument to sprintf warning.
authorMichael Orlitzky <michael@orlitzky.com>
Thu, 24 Aug 2017 11:34:36 +0000 (07:34 -0400)
committerMichael Orlitzky <michael@orlitzky.com>
Thu, 24 Aug 2017 12:14:04 +0000 (08:14 -0400)
commit6afb8e258a5a2a0e7c72c4c25927dde9d1e2ad89
tree5745790b726823c21ffe382c0a2e19fb3fdc45a1
parent84f9fb47783e63757f27e5990ee606ff01e079a9
Fix redundant argument to sprintf warning.

Perl 5.22 now warns about redundant (i.e. extra) arguments to the
sprintf function. If your format string only has two place-holders but
you pass three place-fillers, you get warned:

  Redundant argument in sprintf at ./postfix-logwatch line 1382...

The issue there was that the format string passed to sprintf was
constructed dynamically; sometimes it would contain two place-holders,
and sometimes three. Three place-fillers were always passed, so when
only two place-holders were used, the warning would be thrown. This was
fixed by testing whether or not there are two or three place-holders,
and passing the appropriate number of place-fillers.
postfix-logwatch