nss_wrapper.pl: fix "Use of uninitialized value $i in array element" messages
authorMichael Adam <obnox@samba.org>
Mon, 12 Jan 2009 12:04:40 +0000 (13:04 +0100)
committerMichael Adam <obnox@samba.org>
Mon, 12 Jan 2009 12:04:40 +0000 (13:04 +0100)
I just saw this in "make test" after "SMBD OUTPUT:"...

Michael

lib/nss_wrapper/nss_wrapper.pl

index b1c9be5365bc37234a782c2794d6d98119ed055f..dbb7f85dc47c38e0cd28603291bb829aa218fd1f 100644 (file)
@@ -171,7 +171,7 @@ sub passwd_remove_entry($$)
 {
        my ($passwd, $eref) = @_;
 
-       for(my $i; defined($passwd->{array}[$i]); $i++) {
+       for (my $i = 0; defined($passwd->{array}[$i]); $i++) {
                if ($eref == $passwd->{array}[$i]) {
                        $passwd->{array}[$i] = undef;
                }