From f198ed7ec2aa91fc817372cb10f44ed39f442a95 Mon Sep 17 00:00:00 2001 From: Nathan Scott Date: Wed, 29 Nov 2023 14:04:26 +1100 Subject: [PATCH] pcp-atop: deterministic process sort comparison when handling NULLs --- src/pcp/atop/showlinux.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/pcp/atop/showlinux.c b/src/pcp/atop/showlinux.c index 7a447ee9a6..4bc9af7be6 100644 --- a/src/pcp/atop/showlinux.c +++ b/src/pcp/atop/showlinux.c @@ -2564,6 +2564,7 @@ compusr(const void *a, const void *b) register int uida; register int uidb; + if (ta == tb) return 0; if (ta == NULL) return 1; if (tb == NULL) return -1; @@ -2588,6 +2589,7 @@ compnam(const void *a, const void *b) register char *nama; register char *namb; + if (ta == tb) return 0; if (ta == NULL) return 1; if (tb == NULL) return -1; @@ -2606,6 +2608,7 @@ compcon(const void *a, const void *b) register char *containera; register char *containerb; + if (ta == tb) return 0; if (ta == NULL) return 1; if (tb == NULL) return -1;