]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
scripts: fix two Perl uninitialized value warnings
authorViktor Szakats <commit@vsz.me>
Sun, 27 Jul 2025 21:36:33 +0000 (23:36 +0200)
committerViktor Szakats <commit@vsz.me>
Sun, 27 Jul 2025 23:51:55 +0000 (01:51 +0200)
```
Use of uninitialized value $errors in exit at .github/scripts/badwords.pl line 87.
Use of uninitialized value $o in concatenation (.) or string at ../.github/scripts/randcurl.pl line 99.
```

Follow-up to 2ec54556d4e3f3ab551b5298adab0c703d85a463 #17877
Cherry-picked from #18042
Closes #18047

.github/scripts/badwords.pl
.github/scripts/randcurl.pl

index e51d99f0d1ab28b8962c7fe4f0a95001ec622ffc..bd66f331669b17dd22e9d5a0503b0e82378f1273 100755 (executable)
@@ -40,7 +40,7 @@ while(<STDIN>) {
     }
 }
 
-my $errors;
+my $errors = 0;
 
 sub file {
     my ($f) = @_;
index c07ba9b7de59bde9ff44d66f5c1902f1dfb8fe10..b085d2ef13d5e4058631b0f9b6a2856f90a55652 100755 (executable)
@@ -92,7 +92,7 @@ sub randarg {
         "0123456789".
         ",-?#$%!@ ";
     my $len = getnum(20);
-    my $o;
+    my $o = '';
     for (1 .. $len) {
         $o .= substr($nice, getnum(length($nice)), 1);
     }