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 {