This is an automated email from the git hooks/post-receive script.

git pushed a commit to branch master
in repository evisum.

View the commit online.

commit 4297499597d7463c12a2aecba63f64cde5122b6c
Author: Alastair Poole <m...@alastairpoole.com>
AuthorDate: Mon Mar 17 22:22:38 2025 +0000

    disk: fix sort
---
 NEWS                 | 3 +--
 src/bin/ui/ui_disk.c | 6 +++---
 2 files changed, 4 insertions(+), 5 deletions(-)

diff --git a/NEWS b/NEWS
index 3637d05..c45b46c 100644
--- a/NEWS
+++ b/NEWS
@@ -5,8 +5,7 @@ Evisum 0.6.2
   * Remove horrible desktop files.
   * Update README use markdown.
   * Allow parent process selection from process view.
-  * General fixes.
-
+  * Fix disk usage CPU usage edge case.
 
 ============
 Evisum 0.6.1
diff --git a/src/bin/ui/ui_disk.c b/src/bin/ui/ui_disk.c
index 0130210..dc72b67 100644
--- a/src/bin/ui/ui_disk.c
+++ b/src/bin/ui/ui_disk.c
@@ -371,14 +371,14 @@ static int
 _sort_by_cpu_usage(const void *p1, const void *p2)
 {
    const File_System *fs1, *fs2;
-   int64_t used1 = 0, used2 = 0;
+   double used1 = 0, used2 = 0;
 
    fs1 = p1; fs2 = p2;
 
    if (fs1->usage.used && fs1->usage.total)
-     used1 = fs1->usage.used / (fs1->usage.total / 100);
+     used1 = (double) fs1->usage.used / (fs1->usage.total / 100);
    if (fs2->usage.used && fs2->usage.total)
-     used2 = fs2->usage.used / (fs2->usage.total / 100);
+     used2 = (double) fs2->usage.used / (fs2->usage.total / 100);
 
    if (used1 > used2) return 1;
    if (used1 < used2) return -1;

-- 
To stop receiving notification emails like this one, please contact
the administrator of this repository.

Reply via email to