From 5934816b119fa5625ecf89b8aa85ab2799063c0c Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Thu, 27 Apr 2017 11:26:56 +1000 Subject: [PATCH] tools: check for negative index coming from argv Coverity is unhappy. Signed-off-by: Peter Hutterer --- tools/lur-command.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/lur-command.c b/tools/lur-command.c index 0a11ce68..60deb4f9 100644 --- a/tools/lur-command.c +++ b/tools/lur-command.c @@ -119,7 +119,7 @@ disconnect_device(struct lur_receiver *receiver, int index) return; } - if (index >= ndevices) { + if (index < 0 || index >= ndevices) { fprintf(stderr, "Invalid index %d, only %d devices connected\n", index, ndevices); } else {