summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorcos <cos>2015-10-03 21:56:21 +0200
committercos <cos>2015-10-03 21:56:21 +0200
commit50bfecf318df7c4a2d008d18c496a2058d6789e2 (patch)
treef0b72c8b4288fee9e1d37dcf1b2e2b26aa816a15
parentecaa540af575077444d5ef96d730ff0c96cfca73 (diff)
downloadmat-50bfecf318df7c4a2d008d18c496a2058d6789e2.zip
Initialize counter correctly.
-rwxr-xr-xmat2
1 files changed, 2 insertions, 0 deletions
diff --git a/mat b/mat
index 707a675..12c67d8 100755
--- a/mat
+++ b/mat
@@ -14,6 +14,7 @@ use Text::Iconv;
use utf8;
binmode(STDOUT, 'utf8:');
+# FIXME die on non-existant config
tie my %Config, "Config::Simple", '/etc/mat.conf';
#use Data::Dumper;
@@ -297,6 +298,7 @@ sub cmd_inventory {
$sql .= " WHERE storage='$storage'" if ( $storage );
$sql .= " GROUP BY storage, preparation_date, recipe_id";
+ $total{'all'} = 0;
my $all = $db->selectall_arrayref($sql);
foreach my $row (@$all) {
$total{'all'} += @$row[1];