From: Ian Jackson Date: Tue, 2 Apr 2019 14:56:57 +0000 (+0100) Subject: power: Fix uninitialised variable warning X-Git-Url: http://xenbits.xensource.com/gitweb?a=commitdiff_plain;h=23ac6025259f33c8c5199d49f45b0ef2488fc873;p=osstest.git power: Fix uninitialised variable warning In power: Record approach used for power cycles in runvars we introduced a reference to $r{$rv} which might be undef, resulting in this: Use of uninitialized value in concatenation (.) or string at Osstest/TestSupport.pm line 1069. Signed-off-by: Ian Jackson --- diff --git a/Osstest/TestSupport.pm b/Osstest/TestSupport.pm index 334cc2c..d35a784 100644 --- a/Osstest/TestSupport.pm +++ b/Osstest/TestSupport.pm @@ -1023,7 +1023,7 @@ sub power_reboot_attempts ($$$;$$) { logm("power: rebooted $ho->{Name} (using $approach->{Name})"); if (defined $record_runvar_tail) { my $rv = "$ho->{Ident}_power_${record_runvar_tail}"; - my $newval = $r{$rv}.(!!length($r{$rv}) and ',') + my $newval = ($r{$rv} // '').(!!length($r{$rv}) and ',') .$approach->{Name}; store_runvar($rv, $newval); }