]> git.proxmox.com Git - pve-storage.git/commitdiff
diskmanage: fix determining array length
authorFabian Ebner <f.ebner@proxmox.com>
Mon, 14 Jun 2021 11:40:40 +0000 (13:40 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Tue, 15 Jun 2021 08:10:33 +0000 (10:10 +0200)
$#* is the last index, not the length.

Signed-off-by: Fabian Ebner <f.ebner@proxmox.com>
PVE/Diskmanage.pm

index 55da2e5f285a34b70c5c9e27fa8220866efb8710..ca6f0b7bc5dc9cd5172bd3ba8de0bd967f852f8d 100644 (file)
@@ -915,7 +915,7 @@ sub wipe_blockdev {
        push $to_wipe->@*, "/dev/${part}" if -b "/dev/${part}";
     });
 
-    if (scalar($to_wipe->$#*) > 0) {
+    if (scalar($to_wipe->@*) > 0) {
        print "found child partitions to wipe: ". join(', ', $to_wipe->@*) ."\n";
     }
     push $to_wipe->@*, $devpath; # put actual device last