Commit ced2dc96 authored by Robert Ricci's avatar Robert Ricci

Fix an uninitialized value warning that pops up from time to time.

parent a7482569
......@@ -797,12 +797,15 @@ sub snmpitSetFatal($$;$) {
#
sub printVars($) {
my ($vars) = @_;
if (ref($vars) eq "SNMP::VarList") {
if (!defined($vars)) {
return "[(undefined)]";
} elsif (ref($vars) eq "SNMP::VarList") {
return "[" . join(", ",map( {"[".join(",",@$_)."\]";} @$vars)) . "]";
} elsif (ref($vars) eq "SNMP::Varbind") {
return "[" . join(",",@$vars) . "]";
} elsif (ref($vars) eq "ARRAY") {
return "[" . join(",",@$vars) . "]";
return "[" . join(",",map( {defined($_)? $_ : "(undefined)"} @$vars))
. "]";
} else {
return "[unknown value]";
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment