]> git.ipfire.org Git - thirdparty/public-inbox.git/commitdiff
search_query: fix warnings on bogus `o=' query param
authorEric Wong <e@80x24.org>
Sun, 19 Jan 2025 04:40:58 +0000 (04:40 +0000)
committerEric Wong <e@80x24.org>
Tue, 21 Jan 2025 22:36:51 +0000 (22:36 +0000)
Users may specify non-numeric values for the `o' parameter
which won't be captured.  Avoid uninitialized variable warnings
by assuming `0' when no numeric value is specified.

lib/PublicInbox/SearchQuery.pm

index e0127deae851a1cab7e6029941c37b0f5c9e0c79..b420f1258f57345a7ca2065f7cf374492694f66b 100644 (file)
@@ -22,7 +22,7 @@ sub new {
        bless {
                q => $q,
                x => $qp->{x} || '',
-               o => $o,
+               o => $o // 0,
                l => $l,
                r => (defined $r && $r ne '0'),
                t => (defined $t && $t ne '0'),