mirror of
https://code.blicky.net/yorhel/ncdu.git
synced 2026-01-12 17:08:39 -09:00
Fix division by zero in percent calculation
Broken in previous commit.
This commit is contained in:
parent
90b43755b8
commit
8fb2290d5e
1 changed files with 1 additions and 1 deletions
|
|
@ -222,7 +222,7 @@ const Row = struct {
|
|||
num >>= 10;
|
||||
denom >>= 10;
|
||||
}
|
||||
ui.addstr(&util.fmt5dec(@intCast( (num * 1000 + (denom / 2)) / denom )));
|
||||
ui.addstr(&util.fmt5dec(@intCast( @min(1000, (num * 1000 + (denom / 2)) / @max(1, denom) ))));
|
||||
self.bg.fg(.default);
|
||||
ui.addch('%');
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue