mirror of
https://github.com/monitoring-plugins/monitoring-plugins.git
synced 2026-03-02 21:31:22 -05:00
check_swap: Use sscanf more precisely to avoid false matches
This commit is contained in:
parent
651925dffc
commit
77c0913f75
1 changed files with 1 additions and 1 deletions
|
|
@ -99,7 +99,7 @@ swap_result getSwapFromProcMeminfo(char proc_meminfo[]) {
|
|||
} else if (sscanf(input_buffer,
|
||||
"%*[S]%*[w]%*[a]%*[p]%[TotalFreCchd]%*[:] %lu "
|
||||
"%*[k]%*[B]",
|
||||
str, &tmp_KB)) {
|
||||
str, &tmp_KB) == 2) {
|
||||
|
||||
if (verbose >= 3) {
|
||||
printf("Got %s with %lu\n", str, tmp_KB);
|
||||
|
|
|
|||
Loading…
Reference in a new issue