summaryrefslogtreecommitdiff
path: root/Userland/Utilities
diff options
context:
space:
mode:
authorTim Schumacher <timschumi@gmx.de>2022-07-20 22:46:59 +0200
committerAndreas Kling <kling@serenityos.org>2022-07-21 16:37:04 +0200
commitc938321731fb915951e91d8fe4f3321faa0971bc (patch)
treef8ca4b794f774cb7a162a07ca4d57c0b1f8ac018 /Userland/Utilities
parentbb5db7fba62e3ab06db40d29417ecd8df5171086 (diff)
downloadserenity-c938321731fb915951e91d8fe4f3321faa0971bc.zip
du: Replace home-grown block-based size calculation with `ceil_div`
Diffstat (limited to 'Userland/Utilities')
-rw-r--r--Userland/Utilities/du.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/Userland/Utilities/du.cpp b/Userland/Utilities/du.cpp
index 1e4c271f7c..0c4c128788 100644
--- a/Userland/Utilities/du.cpp
+++ b/Userland/Utilities/du.cpp
@@ -162,7 +162,7 @@ ErrorOr<off_t> print_space_usage(String const& path, DuOption const& du_option,
out("{}", human_readable_size(size));
} else {
constexpr long long block_size = 1024;
- size = size / block_size + (size % block_size != 0);
+ size = ceil_div(size, block_size);
out("{}", size);
}