sprintf rudundancy warnings

This commit is contained in:
frank-cizmich
2016-02-05 13:35:44 -03:00
parent baddc014e1
commit 56b44a7522
16 changed files with 83 additions and 75 deletions

View File

@@ -159,10 +159,12 @@ sub shorten {
$num /= $d;
++$n;
}
# Added indexes 1$, 2$ to sprintf format to avoid 'redundant' warning
# https://bugs.launchpad.net/percona-toolkit/+bug/1480719
return sprintf(
$num =~ m/\./ || $n
? "%.${p}f%s"
: '%d',
? '%1$.'.$p.'f%2$s'
: '%1$d',
$num, $units[$n]);
}