summaryrefslogtreecommitdiff
path: root/NitrokeyManager.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2018-04-10 08:19:42 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2018-04-10 08:19:42 +0200
commit306186faab1bf1b8321fecdb2c50176b35a3f953 (patch)
tree3769e709ceb001ad931ebbab99d336372df127f2 /NitrokeyManager.cc
parent92d4621442795b83dff55009c99e47d4a3d93bef (diff)
parent7f3d4ce81a0a38d9591dc4c746bcb75edfe80caa (diff)
downloadlibnitrokey-306186faab1bf1b8321fecdb2c50176b35a3f953.tar.gz
libnitrokey-306186faab1bf1b8321fecdb2c50176b35a3f953.tar.bz2
Merge branch '102-get_status_invalid'
Fixes #102
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r--NitrokeyManager.cc10
1 files changed, 5 insertions, 5 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index 48196a9..8bb1a2a 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -855,11 +855,11 @@ using nitrokey::misc::strcpyT;
void NitrokeyManager::write_config(uint8_t numlock, uint8_t capslock, uint8_t scrolllock, bool enable_user_password,
bool delete_user_password, const char *admin_temporary_password) {
auto p = get_payload<stick10_08::WriteGeneralConfig>();
- p.numlock = (uint8_t) numlock;
- p.capslock = (uint8_t) capslock;
- p.scrolllock = (uint8_t) scrolllock;
- p.enable_user_password = (uint8_t) enable_user_password;
- p.delete_user_password = (uint8_t) delete_user_password;
+ p.numlock = numlock;
+ p.capslock = capslock;
+ p.scrolllock = scrolllock;
+ p.enable_user_password = static_cast<uint8_t>(enable_user_password ? 1 : 0);
+ p.delete_user_password = static_cast<uint8_t>(delete_user_password ? 1 : 0);
if (is_authorization_command_supported()){
authorize_packet<stick10_08::WriteGeneralConfig, Authorize>(p, admin_temporary_password, device);
} else {