mirror of
https://github.com/moparisthebest/pacman
synced 2025-03-01 01:41:52 -05:00
Ensure humanize_size works for negative values
Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
This commit is contained in:
parent
5b33f48389
commit
e92083798c
@ -831,7 +831,7 @@ double humanize_size(off_t bytes, const char target_unit, int long_labels,
|
||||
for(index = 0; index < unitcount - 1; index++) {
|
||||
if(target_unit != '\0' && shortlabels[index][0] == target_unit) {
|
||||
break;
|
||||
} else if(target_unit == '\0' && val <= 2048.0) {
|
||||
} else if(target_unit == '\0' && val <= 2048.0 && val >= -2048.0) {
|
||||
break;
|
||||
}
|
||||
val /= 1024.0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user