diff --git a/proxmox-backup-client/src/main.rs b/proxmox-backup-client/src/main.rs index 55198108..5a804d95 100644 --- a/proxmox-backup-client/src/main.rs +++ b/proxmox-backup-client/src/main.rs @@ -1590,9 +1590,12 @@ async fn status(param: Value) -> Result { let v = v.as_u64().unwrap(); let total = record["total"].as_u64().unwrap(); let roundup = total / 200; - let per = ((v + roundup) * 100) / total; - let info = format!(" ({} %)", per); - Ok(format!("{} {:>8}", v, info)) + if let Some(per) = ((v + roundup) * 100).checked_div(total) { + let info = format!(" ({} %)", per); + Ok(format!("{} {:>8}", v, info)) + } else { + bail!("Cannot render total percentage: denominator is zero"); + } }; let options = default_table_format_options()