From 5a5d9f7f310583bbf9aa89fdbae8347d37e3126e Mon Sep 17 00:00:00 2001 From: SashaXser <24498484+SashaXser@users.noreply.github.com> Date: Sat, 12 Oct 2024 20:48:24 +0400 Subject: [PATCH] Fix code scanning alert no. 2: Incorrect return-value check for a 'scanf'-like function Co-authored-by: Copilot Autofix powered by AI <62310815+github-advanced-security[bot]@users.noreply.github.com> --- tpws/tpws.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tpws/tpws.c b/tpws/tpws.c index 383edef..e67b3b3 100644 --- a/tpws/tpws.c +++ b/tpws/tpws.c @@ -1087,7 +1087,7 @@ static bool read_system_maxfiles(rlim_t *maxfile) return false; n=fscanf(F,"%ju",&um); fclose(F); - if (!n) return false; + if (n != 1) return false; *maxfile = (rlim_t)um; return true; #elif defined(BSD)