1
0
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:
Peter Hutterer
2017-04-27 11:26:56 +10:00
committed by bentiss
parent 28dd84713f
commit 5934816b11

View File

@@ -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 {