Merge pull request #2 from SashaXser/alert-autofix-2

Fix code scanning alert no. 2: Incorrect return-value check for a 'scanf'-like function
This commit is contained in:
SashaXser 2024-10-12 20:49:39 +04:00 committed by GitHub
commit e64a6bc9a4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -1087,7 +1087,7 @@ static bool read_system_maxfiles(rlim_t *maxfile)
return false; return false;
n=fscanf(F,"%ju",&um); n=fscanf(F,"%ju",&um);
fclose(F); fclose(F);
if (!n) return false; if (n != 1) return false;
*maxfile = (rlim_t)um; *maxfile = (rlim_t)um;
return true; return true;
#elif defined(BSD) #elif defined(BSD)