From fdbb0629bc4cf21c1ad8d1c353a4d015b2816cbd Mon Sep 17 00:00:00 2001 From: Ken McDonell Date: Mon, 5 Feb 2024 12:07:01 +1100 Subject: 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 --- pcp/Platform.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'pcp') 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; } -- cgit v1.2.3