From 323f0cc043e27db0e086a3a6e59dbf3d0a2d7c7f Mon Sep 17 00:00:00 2001 From: Jamie Cameron Date: Fri, 14 Jul 2023 16:51:25 -0700 Subject: [PATCH] Use formal params --- bind8/records-lib.pl | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/bind8/records-lib.pl b/bind8/records-lib.pl index d95dac4d3..c124fe556 100755 --- a/bind8/records-lib.pl +++ b/bind8/records-lib.pl @@ -495,11 +495,10 @@ return $name. # Increase the serial number in some SOA record by 1 sub bump_soa_record { -my($r, $v, $vals); -for(my $i=0; $i<@{$_[1]}; $i++) { - $r = $_[1]->[$i]; +my ($file, $recs) = @_; +foreach my $r (@$recs) { if ($r->{'type'} eq "SOA") { - $v = $r->{'values'}; + my $v = $r->{'values'}; # already set serial if no acl allow it to update or update # is disabled my $serial = $v->[2]; @@ -507,8 +506,8 @@ for(my $i=0; $i<@{$_[1]}; $i++) { # automatically handle serial numbers ? $serial = &compute_serial($v->[2]); } - $vals = "$v->[0] $v->[1] (\n\t\t\t$serial\n\t\t\t$v->[3]\n". - "\t\t\t$v->[4]\n\t\t\t$v->[5]\n\t\t\t$v->[6] )"; + my $vals = "$v->[0] $v->[1] (\n\t\t\t$serial\n\t\t\t$v->[3]\n". + "\t\t\t$v->[4]\n\t\t\t$v->[5]\n\t\t\t$v->[6] )"; &modify_record($r->{'file'}, $r, $r->{'realname'}, $r->{'ttl'}, $r->{'class'}, $r->{'type'}, $vals); }