diff options
author | Szczepan Zalega <szczepan.zalega@gmail.com> | 2016-02-20 15:40:05 +0100 |
---|---|---|
committer | Szczepan Zalega <szczepan.zalega@gmail.com> | 2016-02-20 15:40:05 +0100 |
commit | 5ed712b2f0471d4f1210fc3be6080aeaaf4b126a (patch) | |
tree | f4d6c8527af73cda9226b75b6037c3621893b52d /device.cc | |
parent | a0db16048f81313604a06509cc6afeb5cdbf740d (diff) | |
download | libnitrokey-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.cc | 2 |
1 files changed, 1 insertions, 1 deletions
@@ -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); } |