From 50bfecf318df7c4a2d008d18c496a2058d6789e2 Mon Sep 17 00:00:00 2001 From: cos Date: Sat, 3 Oct 2015 21:56:21 +0200 Subject: Initialize counter correctly. --- mat | 2 ++ 1 file changed, 2 insertions(+) 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]; -- cgit v1.2.3