From 5a53fb4a2ce8d869733c4bf1c76bf9e8b8400297 Mon Sep 17 00:00:00 2001 From: aristocratos Date: Sun, 6 Nov 2022 11:32:17 +0100 Subject: [PATCH] Fixed: Process nice value underflowing, issue #461 --- src/btop_shared.hpp | 2 +- src/linux/btop_collect.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/btop_shared.hpp b/src/btop_shared.hpp index 919bc31..f9275a4 100644 --- a/src/btop_shared.hpp +++ b/src/btop_shared.hpp @@ -262,7 +262,7 @@ namespace Proc { double cpu_p{}; // defaults to = 0.0 double cpu_c{}; // defaults to = 0.0 char state = '0'; - uint64_t p_nice{}; // defaults to 0 + int64_t p_nice{}; // defaults to 0 uint64_t ppid{}; // defaults to 0 uint64_t cpu_s{}; // defaults to 0 uint64_t cpu_t{}; // defaults to 0 diff --git a/src/linux/btop_collect.cpp b/src/linux/btop_collect.cpp index fd90588..cec781d 100644 --- a/src/linux/btop_collect.cpp +++ b/src/linux/btop_collect.cpp @@ -1884,7 +1884,7 @@ namespace Proc { next_x = 19; continue; case 19: //? Nice value - new_proc.p_nice = stoull(short_str); + new_proc.p_nice = stoll(short_str); continue; case 20: //? Number of threads new_proc.threads = stoull(short_str);