From 93740519d3a3718701e65f88ff9b0d15f09506d7 Mon Sep 17 00:00:00 2001 From: Jordi Sanfeliu Date: Wed, 27 Mar 2013 18:58:15 +0100 Subject: [PATCH] avoid use of a possible uninitialized variable in to_fahrenheix() function --- lib/Monitorix.pm | 1 + 1 file changed, 1 insertion(+) diff --git a/lib/Monitorix.pm b/lib/Monitorix.pm index acc080e..6805f34 100644 --- a/lib/Monitorix.pm +++ b/lib/Monitorix.pm @@ -54,6 +54,7 @@ sub max { sub to_fahrenheit { my ($config, $celsius) = @_; + $celsius = $celsius || 0; if(lc($config->{temperatures_scale}) eq "f") { return ($celsius * (9 / 5)) + 32; }