From c99034bfa6415df2a466d41bfdcdbd7eab3393c9 Mon Sep 17 00:00:00 2001 From: rudolfkoenig <> Date: Sat, 9 Jul 2016 11:11:48 +0000 Subject: [PATCH] 98_SVG.pm: fix division by zero (Forum #55435) git-svn-id: https://svn.fhem.de/fhem/trunk@11771 2b470e98-0d58-463d-a4d8-8e2adae1ed80 --- fhem/FHEM/98_SVG.pm | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fhem/FHEM/98_SVG.pm b/fhem/FHEM/98_SVG.pm index 3957d28e2..fc5e2af1f 100755 --- a/fhem/FHEM/98_SVG.pm +++ b/fhem/FHEM/98_SVG.pm @@ -1424,7 +1424,7 @@ SVG_render($$$$$$$$$$) $fromsec = SVG_time_to_sec($from) if($from ne "0"); # 0 is special $tosec = SVG_time_to_sec($to) if($to ne "9"); # 9 is special my $tmul; - $tmul = $w/($tosec-$fromsec) if($tosec && $fromsec); + $tmul = $w/($tosec-$fromsec) if($tosec && $fromsec && $tosec != $fromsec); my ($min, $max, $idx) = (99999999, -99999999, 0); my (%hmin, %hmax, @hdx, @hdy); @@ -1505,7 +1505,7 @@ SVG_render($$$$$$$$$$) if(!$tmul) { # recompute the x data if no range sepcified $fromsec = SVG_time_to_sec($dxp->[0]) if(!$fromsec); $tosec = SVG_time_to_sec($dxp->[int(@{$dxp})-1]) if(!$tosec); - $tmul = $w/($tosec-$fromsec); + $tmul = $w/($tosec-$fromsec) if($tosec != $fromsec); for my $i (0..@hdx-1) { $dxp = $hdx[$i];