summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJakob Gruber <jakob.gruber@gmail.com>2011-06-15 11:04:09 +0200
committerDan McGee <dan@archlinux.org>2011-06-15 09:14:00 -0500
commite92083798cdd98961e0d2befe25af7a8f96c9ab5 (patch)
tree1a9e8debed8c89a777a40527505d0fe1fd805173 /src
parent5b33f48389531e47a0093e84feedce0f63a94c77 (diff)
downloadpacman-e92083798cdd98961e0d2befe25af7a8f96c9ab5.tar.xz
Ensure humanize_size works for negative values
Signed-off-by: Jakob Gruber <jakob.gruber@gmail.com> Signed-off-by: Dan McGee <dan@archlinux.org>
Diffstat (limited to 'src')
-rw-r--r--src/pacman/util.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/pacman/util.c b/src/pacman/util.c
index d142cb75..2a7b3773 100644
--- a/src/pacman/util.c
+++ b/src/pacman/util.c
@@ -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;