From e7f6d1ce5fa5b10c856f4e4b2e0c062d3b6f7b74 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20G=C3=B6ttsche?= Date: Mon, 31 Aug 2020 11:55:53 +0200 Subject: Reduce oom cast from long to int Oom values should never be greater then INT_MAX, they should be in the range 0 - 1000. Improves: d9a5dd4b916636b5e7ba8631885427372f0cfcad --- linux/LinuxProcess.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/linux/LinuxProcess.c b/linux/LinuxProcess.c index 6bae9886..5970c938 100644 --- a/linux/LinuxProcess.c +++ b/linux/LinuxProcess.c @@ -492,7 +492,7 @@ long LinuxProcess_compare(const void* v1, const void* v2) { return strcmp(p1->cgroup ? p1->cgroup : "", p2->cgroup ? p2->cgroup : ""); #endif case OOM: - return ((long)p2->oom - (long)p1->oom); + return ((int)p2->oom - (int)p1->oom); #ifdef HAVE_DELAYACCT case PERCENT_CPU_DELAY: return (p2->cpu_delay_percent > p1->cpu_delay_percent ? 1 : -1); -- cgit v1.2.3