aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Duggan <andrew@ck7726.com>2014-10-07 21:58:02 -0700
committerAndrew Duggan <aduggan@synaptics.com>2014-10-08 15:37:26 -0700
commitf6e278f677ae60c9db728059bc942bbeb9aec549 (patch)
treee43184485fe9984f36c010b20d67999774ff4a47
parent7f495fb82680116312f255d168e352e514802a69 (diff)
downloadplatform_external_rmi4utils-f6e278f677ae60c9db728059bc942bbeb9aec549.tar.gz
platform_external_rmi4utils-f6e278f677ae60c9db728059bc942bbeb9aec549.tar.bz2
platform_external_rmi4utils-f6e278f677ae60c9db728059bc942bbeb9aec549.zip
Stop printing attention reports if GetAttentionReport fails
-rw-r--r--rmihidtool/main.cpp8
1 files changed, 5 insertions, 3 deletions
diff --git a/rmihidtool/main.cpp b/rmihidtool/main.cpp
index 8641b3b..f8a1770 100644
--- a/rmihidtool/main.cpp
+++ b/rmihidtool/main.cpp
@@ -323,9 +323,11 @@ int main(int argc, char ** argv)
report_attn = 1;
while(report_attn) {
unsigned int bytes = 256;
- device->GetAttentionReport(NULL, NULL, report, &bytes);
- print_buffer(report, bytes);
- fprintf(stdout, "\n");
+ rc = device->GetAttentionReport(NULL, NULL, report, &bytes);
+ if (rc > 0) {
+ print_buffer(report, bytes);
+ fprintf(stdout, "\n");
+ }
}
break;
case RMIHIDTOOL_CMD_PRINT_FUNCTIONS: