passing -1 will break the while loop further down in the code. Signed-off-by: John Crispin <john@xxxxxxxxxxx> --- mgmt.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/mgmt.c b/mgmt.c index 88fe3fd..338435d 100644 --- a/mgmt.c +++ b/mgmt.c @@ -109,6 +109,8 @@ static int handle_mgmt_dump(struct nl80211_state *state, for (i = 3; i < argc; i += 3) { if (strcmp(argv[i], "count") == 0) { count = 1 + atoi(argv[i + 1]); + if (count < 1) + count = 1; break; } -- 2.20.1