From: Dirk Koopman Date: Wed, 5 Jan 2022 19:45:16 +0000 (+0000) Subject: fix some pedantic warnings X-Git-Url: http://dxcluster.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=2fe3813e70786483d2d928f8fa44eb9ff9cb76ca;p=spider.git fix some pedantic warnings --- diff --git a/perl/DXLogPrint.pm b/perl/DXLogPrint.pm index 32f39c26..92deee42 100644 --- a/perl/DXLogPrint.pm +++ b/perl/DXLogPrint.pm @@ -114,7 +114,7 @@ sub search return "show/$name: ${s}not found"; } - for (sort {$a <=> $b } @in) { + for (sort {$a cmp $b } @in) { push @out, [ split /\^/ ] } diff --git a/perl/DXProtHandle.pm b/perl/DXProtHandle.pm index 1ba996c8..4572b94e 100644 --- a/perl/DXProtHandle.pm +++ b/perl/DXProtHandle.pm @@ -1556,6 +1556,8 @@ sub _decode_pc92_call my $is_extnode = $flag & 2; my $here = $flag & 1; my $ip; + $part[1] //= 0; + $part[2] //= 0; if ($part[1] =~ /[,.]/) { $ip = $part[1]; $part[1] = $part[2] = 0; diff --git a/perl/DXUser.pm b/perl/DXUser.pm index a4283c33..dd56498e 100644 --- a/perl/DXUser.pm +++ b/perl/DXUser.pm @@ -499,7 +499,7 @@ print "There are $count user records and $err errors in $diff mS\n"; $t //= 0; if ($ref->is_user) { - if ($ref->{priv} == 0 && $main::systime > $t + $tooold) { + if (!$ref->{priv} && $main::systime > $t + $tooold) { unless (($ref->{lat} && $ref->{long}) || $ref->{qth} || $ref->{name} || $ref->{qra}) { LogDbg('DXCommand', sprintf("$ref->{call} deleted, empty and too Old at %s", difft($t, ' '))); ++$del; @@ -517,7 +517,7 @@ print "There are $count user records and $err errors in $diff mS\n"; dbg(carp("Export Error2: delete '$key' => '$val' $@")) if $@; next; } - if ($ref->{lockout} == 1 && $ref->{priv} == 1) { + if (exists $ref->{lockout} && $ref->{lockout} == 1 && exists $ref->{priv} && $ref->{priv} == 1) { LogDbg('DXCommand', "$ref->{call} depriv'd and unlocked"); $ref->{lockout} = $ref->{priv} = 0; $ref->put;