aboutsummaryrefslogtreecommitdiff
path: root/device.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2018-06-19 23:19:06 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2018-06-19 23:19:06 +0200
commit49413927e68189aa91199f429675487e86231636 (patch)
tree0a599e71efe03de35a06009280dc8247452c255b /device.cc
parent5910ec72e0f7abd3f6c876e04a07057b0dd8edaa (diff)
downloadlibnitrokey-49413927e68189aa91199f429675487e86231636.tar.gz
libnitrokey-49413927e68189aa91199f429675487e86231636.tar.bz2
Add test
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'device.cc')
-rw-r--r--device.cc6
1 files changed, 4 insertions, 2 deletions
diff --git a/device.cc b/device.cc
index da54e33..80e4b38 100644
--- a/device.cc
+++ b/device.cc
@@ -69,8 +69,10 @@ bool Device::_disconnect() {
LOG(std::string(__FUNCTION__) + std::string(m_model == DeviceModel::PRO ? "PRO" : "STORAGE"), Loglevel::DEBUG_L2);
LOG(std::string(__FUNCTION__) + std::string(" *IN* "), Loglevel::DEBUG_L2);
- LOG(std::string("Disconnection: handle already freed: ") + std::to_string(mp_devhandle == nullptr) + " ("+m_path+")", Loglevel::DEBUG_L1);
- if(mp_devhandle == nullptr) return false;
+ if(mp_devhandle == nullptr) {
+ LOG(std::string("Disconnection: handle already freed: ") + std::to_string(mp_devhandle == nullptr) + " ("+m_path+")", Loglevel::DEBUG_L1);
+ return false;
+ }
hid_close(mp_devhandle);
mp_devhandle = nullptr;