fixed division by zero foerste
authorMatthias Förste foerste@schlittermann.de
Tue, 29 Nov 2011 13:19:44 +0100
branchfoerste
changeset 51 fd55e111838d
parent 50 aca7592c284b
child 52 aad3d38deac0
fixed division by zero
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;