aboutsummaryrefslogtreecommitdiff
path: root/rmihidtool
diff options
context:
space:
mode:
authorAndrew Duggan <aduggan@synaptics.com>2014-04-29 13:37:42 -0700
committerAndrew Duggan <aduggan@synaptics.com>2014-04-29 13:37:42 -0700
commit4667eb766d9b05a54426107c765bf371c8593d0c (patch)
tree0c0a3817d89358b146bd83457b2100cb307f1c62 /rmihidtool
parente9a5cd0172ce96168a9431531d259b677f331aa6 (diff)
downloadrmi4utils-4667eb766d9b05a54426107c765bf371c8593d0c.tar.gz
Make sure the device file is specified.
Diffstat (limited to 'rmihidtool')
-rw-r--r--rmihidtool/main.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/rmihidtool/main.cpp b/rmihidtool/main.cpp
index 564d771..45d5721 100644
--- a/rmihidtool/main.cpp
+++ b/rmihidtool/main.cpp
@@ -272,6 +272,11 @@ int main(int argc, char ** argv)
return -1;
}
+ if (optind >= argc) {
+ print_help(argv[0]);
+ return -1;
+ }
+
rc = device->Open(argv[optind++]);
if (rc) {
fprintf(stderr, "%s: failed to initialize rmi device (%d): %s\n", argv[0], errno,