avoid division by zero in progress computation

This commit is contained in:
Johannes Schauer Marin Rodrigues 2022-12-22 10:13:01 +01:00
parent ccd8919e67
commit 2fd3d768e8
Signed by untrusted user: josch
GPG key ID: F2CBA5C78FBD83E1

View file

@ -950,7 +950,11 @@ sub run_dpkg_progress {
}
$num += 1;
}
if ($total == 0) {
return 0, $status;
} else {
return $num / $total * 100, $status;
}
};
run_progress $get_exec, $line_handler, $line_has_error;
return;