aboutsummaryrefslogtreecommitdiff
path: root/device.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan.zalega@gmail.com>2016-02-20 15:40:05 +0100
committerSzczepan Zalega <szczepan.zalega@gmail.com>2016-02-20 15:40:05 +0100
commit5ed712b2f0471d4f1210fc3be6080aeaaf4b126a (patch)
treef4d6c8527af73cda9226b75b6037c3621893b52d /device.cc
parenta0db16048f81313604a06509cc6afeb5cdbf740d (diff)
downloadlibnitrokey-5ed712b2f0471d4f1210fc3be6080aeaaf4b126a.tar.gz
libnitrokey-5ed712b2f0471d4f1210fc3be6080aeaaf4b126a.tar.bz2
checking status correctly (in specification hid_get_feature_report returns number of received bytes+1, so its never under 1 when successful)
Diffstat (limited to 'device.cc')
-rw-r--r--device.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/device.cc b/device.cc
index e4ec8bd..3aca2b2 100644
--- a/device.cc
+++ b/device.cc
@@ -56,7 +56,7 @@ CommError Device::recv(void *packet) {
status = (CommError)(
hid_get_feature_report(mp_devhandle, (unsigned char *)(packet),
HID_REPORT_SIZE));
- if (status == CommError::ERR_NO_ERROR || retry_count++ >= m_retry_count)
+ if ((int)status >0 || retry_count++ >= m_retry_count)
break;
std::this_thread::sleep_for(m_retry_timeout);
}