removing warnings for uninitialized values

when 'alt', 'cve' or 'mil' data is not available, the variables
contain the undefined value. As such, calling length() on them
trigger a warning. This patch changes the validation to simply
check if the variables are defined.
This commit is contained in:
Breno G. de Oliveira 2013-09-05 15:48:25 -03:00
commit ccbc19f92c

View file

@ -102,10 +102,10 @@ foreach my $key(keys %h){
my $alt = $h{$key}->{alt};
my $cve = $h{$key}->{cve};
my $mlw = $h{$key}->{mil};
if ((length ($alt) >0)||(length ($cve) >0)){print "\n";}
if (length ($alt) >0){ print " Alt: $alt ";}
if (length ($cve) >0){ print " CVE-$cve";}
if (length ($mlw) >0){ print "\n Source: $mlw";}
if ($alt or $cve){print "\n";}
if ($alt){ print " Alt: $alt ";}
if ($cve){ print " CVE-$cve";}
if ($mlw){ print "\n Source: $mlw";}
print "\n";
}
}