# HG changeset patch # User Matthias Förste foerste@schlittermann.de # Date 1322569184 -3600 # Node ID fd55e111838d536de0788b92ac784fd079e45817 # Parent aca7592c284bc9f69911cf52a1132daba69fe28a fixed division by zero diff -r aca7592c284b -r fd55e111838d account.pm --- a/account.pm Mon Nov 28 15:04:40 2011 +0100 +++ b/account.pm Tue Nov 29 13:19:44 2011 +0100 @@ -471,6 +471,7 @@ my $elem = ''; $elem = shift @q while defined $elem and $elem ne 'STORAGE'; my ( $used, $max ) = map { int( $_ / 1024 ) } @q[ 0 .. 1 ]; + $max ||= 1; print ", quota '$qr': $used/${max}MB " . int( 100 * $used / $max ) . "%"; $has_quota = 1;