From: Moritz Bunkus Date: Mon, 2 Nov 2015 14:02:39 +0000 (+0100) Subject: Form->format_amount: Warnung über negativen repeat count vermeiden X-Git-Tag: release-3.4.1~603 X-Git-Url: http://wagnertech.de/git?a=commitdiff_plain;h=67588d37a1fcdaed2ffdac55feaea26e488537d4;p=kivitendo-erp.git Form->format_amount: Warnung über negativen repeat count vermeiden Warnung erscheint, wenn bei Konstrukten wie »'str' x $anzahl« die $anzahl negativ ist. --- diff --git a/SL/Form.pm b/SL/Form.pm index c59669c41..c29097289 100644 --- a/SL/Form.pm +++ b/SL/Form.pm @@ -839,7 +839,7 @@ sub format_amount { if ($places || $p[1]) { $amount .= $d[0] . ( $p[1] || '' ) - . (0 x (abs($places || 0) - length ($p[1]||''))); # pad the fraction + . (0 x max(abs($places || 0) - length ($p[1]||''), 0)); # pad the fraction } $amount = do {