summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTom Heimbrodt <heimbrodt@posteo.de>2019-10-16 21:55:07 +0200
committernachoparker <nacho@ownyourbits.com>2019-10-21 23:40:10 -0600
commit72344f2780a37c947495ceb400a3ab59d4da8117 (patch)
treefb5e930885ffbe85e0b1868b9d2ec9be2f748386
parent6352bc66ae9b34c34dbbfc0c414342771b594061 (diff)
Increase integer size to store 1024^4. Fixes #13v0.2.13
Signed-off-by: nachoparker <nacho@ownyourbits.com>
-rw-r--r--Cargo.lock2
-rw-r--r--Cargo.toml2
-rw-r--r--src/lib.rs2
3 files changed, 3 insertions, 3 deletions
diff --git a/Cargo.lock b/Cargo.lock
index fb44339..1f989d6 100644
--- a/Cargo.lock
+++ b/Cargo.lock
@@ -15,7 +15,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index"
[[package]]
name = "dutree"
-version = "0.2.12"
+version = "0.2.13"
dependencies = [
"getopts 0.2.21 (registry+https://github.com/rust-lang/crates.io-index)",
"regex 1.3.1 (registry+https://github.com/rust-lang/crates.io-index)",
diff --git a/Cargo.toml b/Cargo.toml
index e44bd42..0fdbb85 100644
--- a/Cargo.toml
+++ b/Cargo.toml
@@ -1,6 +1,6 @@
[package]
name = "dutree"
-version = "0.2.12"
+version = "0.2.13"
authors = ["nacho <nacho@ownyourbits.com>"]
description = "Command line tool to analyze disk usage"
repository = "https://github.com/nachoparker/dutree"
diff --git a/src/lib.rs b/src/lib.rs
index eb83e65..cb8a1ba 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -460,7 +460,7 @@ fn fmt_size_str( bytes : u64, flag : bool ) -> String {
else if bytes < 1024u64.pow(2) { format!( "{:.2} KiB", b/1024.0 ) }
else if bytes < 1024u64.pow(3) { format!( "{:.2} MiB", b/(1024u32.pow(2) as f32)) }
else if bytes < 1024u64.pow(4) { format!( "{:.2} GiB", b/(1024u32.pow(3) as f32)) }
- else { format!( "{:.2} TiB", b/(1024u32.pow(4) as f32)) }
+ else { format!( "{:.2} TiB", b/(1024u64.pow(4) as f32)) }
}
fn get_bytes( path: &Path, usage_flag : bool ) -> u64 {