mirror of
https://git.proxmox.com/git/fwupd
synced 2025-08-14 10:22:17 +00:00
trivial: Fix a potential division by zero
Spotted by Coverity.
This commit is contained in:
parent
4b09701452
commit
f302bbcb03
@ -564,6 +564,8 @@ fu_progress_get_step_percentage(FuProgress *self, guint idx)
|
||||
current += step->value;
|
||||
total += step->value;
|
||||
}
|
||||
if (total == 0)
|
||||
return 0;
|
||||
return ((gdouble)current * 100.f) / (gdouble)total;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user