summaryrefslogtreecommitdiffstats
path: root/pcp
diff options
context:
space:
mode:
authorKen McDonell <kenj@kenj.id.au>2024-02-05 12:07:01 +1100
committerBenBE <BenBE@geshi.org>2024-02-05 22:24:46 +0100
commitfdbb0629bc4cf21c1ad8d1c353a4d015b2816cbd (patch)
tree65971aeef35df12893d38f5d14186b795e1333bd /pcp
parent541c17c975bc8a4f1f243e568006b0e26ae52c47 (diff)
Minor bug fixes for Coverity issues
Over in the PCP project, Coverity has spotted a couple of minor issues in the htop code. This commit addresses them: Settings.c need to take control of the umask before calling mkstemp() pcp/Platform.c Although Platform_getMaxPid() returns a pid_t (which strictly speaking is signed), the value is used to call Row_setPidColumnWidth() and a negative value here is not good ... using INT_MAX instead of UNIT_MAX on the (unlikely) error path makes no practical difference but may keep Coverity quiet
Diffstat (limited to 'pcp')
-rw-r--r--pcp/Platform.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/pcp/Platform.c b/pcp/Platform.c
index 0b5f3344..d50edd25 100644
--- a/pcp/Platform.c
+++ b/pcp/Platform.c
@@ -480,7 +480,7 @@ pid_t Platform_getMaxPid(void) {
pmAtomValue value;
if (Metric_values(PCP_PID_MAX, &value, 1, PM_TYPE_32) == NULL)
- return UINT_MAX;
+ return INT_MAX;
pcp->pidmax = value.l;
return pcp->pidmax;
}