mirror of https://github.com/mikaku/Monitorix.git
avoid use of a possible uninitialized variable in to_fahrenheix() function
This commit is contained in:
parent
4efc293f6e
commit
93740519d3
|
@ -54,6 +54,7 @@ sub max {
|
||||||
sub to_fahrenheit {
|
sub to_fahrenheit {
|
||||||
my ($config, $celsius) = @_;
|
my ($config, $celsius) = @_;
|
||||||
|
|
||||||
|
$celsius = $celsius || 0;
|
||||||
if(lc($config->{temperatures_scale}) eq "f") {
|
if(lc($config->{temperatures_scale}) eq "f") {
|
||||||
return ($celsius * (9 / 5)) + 32;
|
return ($celsius * (9 / 5)) + 32;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue