mirror of
https://github.com/xzeldon/htop.git
synced 2025-07-15 21:44:36 +03:00
fix compiler warnings
gcc gives warnings like this: warning: ignoring return value of ‘fscanf’, declared with attribute warn_unused_result Assign value to a variable, cast to (void) to discard it.
This commit is contained in:
@ -94,7 +94,8 @@ ProcessList* ProcessList_new(UsersTable* usersTable, Hashtable* pidWhiteList, ui
|
||||
int cpus = -1;
|
||||
do {
|
||||
cpus++;
|
||||
fgets(buffer, 255, file);
|
||||
char * s = fgets(buffer, 255, file);
|
||||
(void) s;
|
||||
} while (String_startsWith(buffer, "cpu"));
|
||||
fclose(file);
|
||||
|
||||
|
@ -110,7 +110,8 @@ int Platform_getMaxPid() {
|
||||
FILE* file = fopen(PROCDIR "/sys/kernel/pid_max", "r");
|
||||
if (!file) return -1;
|
||||
int maxPid = 4194303;
|
||||
(void) fscanf(file, "%32d", &maxPid);
|
||||
int match = fscanf(file, "%32d", &maxPid);
|
||||
(void) match;
|
||||
fclose(file);
|
||||
return maxPid;
|
||||
}
|
||||
|
Reference in New Issue
Block a user