aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorB. Watson <urchlay@slackware.uk>2025-12-11 03:22:58 -0500
committerB. Watson <urchlay@slackware.uk>2025-12-11 03:22:58 -0500
commitae06ce5a0317b949a74562a09e74177e78267a9b (patch)
tree4fbdc655afdf1edfa626874764eb63df0899cad6 /src
parent6ad0c47dae06258fafcd7a34256494e223fbb82f (diff)
downloadalftools-ae06ce5a0317b949a74562a09e74177e78267a9b.tar.gz
alf: Avoid division by zero.
Diffstat (limited to 'src')
-rw-r--r--src/alf.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/src/alf.c b/src/alf.c
index 09f1d76..8eadccd 100644
--- a/src/alf.c
+++ b/src/alf.c
@@ -189,6 +189,7 @@ void convert_eols(void) {
}
int percent(unsigned int out, unsigned int in) {
+ if(!in) return 0;
return 100 - (int)((float)out / (float)in * 100.0);
}