forked from drath/libratbag
tools: check for negative index coming from argv
Coverity is unhappy. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
@@ -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 {
|
||||
|
||||
Reference in New Issue
Block a user