]> git.sesse.net Git - skvidarsync/commitdiff
Fix an off-by-one.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 14 Nov 2023 08:34:20 +0000 (09:34 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Tue, 14 Nov 2023 08:34:20 +0000 (09:34 +0100)
bin/sync.pl

index 84b66d11f47e40cde392230304c55d5d242c6a33..b12125b1a295e2b733929844bec4bd7878f091ba 100644 (file)
@@ -151,7 +151,7 @@ sub matches_name {
        if (scalar @$ap >= 2 && scalar @bp >= 2 && $ap->[0] eq $bp[0]) {
                # First name matches, try to match some surname
                my $found = 0;
-               for my $ai (1..(scalar @$ap)) {
+               for my $ai (1..(scalar @$ap - 1)) {
                        for my $bi (1..$#bp) {
                                $found = 1 if ($ap->[$ai] eq $bp[$bi]);
                        }