Merge pull request #1654 from wolfgangkarall/master

check_procs -- exchange needle and haystack in strstr() for proper st…
This commit is contained in:
RincewindsHat 2021-11-17 18:09:25 +01:00 committed by GitHub
commit 4549a95243
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 2 deletions

View file

@ -265,7 +265,7 @@ main (int argc, char **argv)
}
}
if ((options & STAT) && (strstr (statopts, procstat)))
if ((options & STAT) && (strstr (procstat, statopts)))
resultsum |= STAT;
if ((options & ARGS) && procargs && (strstr (procargs, args) != NULL))
resultsum |= ARGS;

View file

@ -96,7 +96,7 @@ is( $result->output, 'PROCS OK: 3 processes with RSS >= 100000 | procs=3;;;0;',
$result = NPTest->testCmd( "$command -s S" );
is( $result->return_code, 0, "Checking filter for sleeping processes" );
like( $result->output, '/^PROCS OK: 44 processes with STATE = S/', "Output correct" );
like( $result->output, '/^PROCS OK: 88 processes with STATE = S/', "Output correct" );
$result = NPTest->testCmd( "$command -s Z" );
is( $result->return_code, 0, "Checking filter for zombies" );