aboutsummaryrefslogtreecommitdiff
path: root/include/stick10_commands.h
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-10-22 15:29:59 +0200
committerszszszsz <szszszsz@users.noreply.github.com>2016-10-22 15:33:07 +0200
commit2b3c815af73f31a4e12db6ed92290cf76b8e2914 (patch)
tree1cd572a6174dd5261bb9a54061058f14c70f4be6 /include/stick10_commands.h
parent82a0fc21f039971acac18df0ee57e2bb010865e1 (diff)
downloadlibnitrokey-2b3c815af73f31a4e12db6ed92290cf76b8e2914.tar.gz
libnitrokey-2b3c815af73f31a4e12db6ed92290cf76b8e2914.tar.bz2
Fix compilation warning and error under G++ - use union to reach uint8 slot_counter for NK Storage. Fixes #46
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'include/stick10_commands.h')
-rw-r--r--include/stick10_commands.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/include/stick10_commands.h b/include/stick10_commands.h
index a947e1e..f02fd70 100644
--- a/include/stick10_commands.h
+++ b/include/stick10_commands.h
@@ -104,7 +104,10 @@ class WriteToHOTPSlot : Command<CommandID::WRITE_TO_SLOT> {
uint8_t keyboard_layout; //disabled feature in nitroapp as of 20160805
} slot_token_fields;
};
- uint64_t slot_counter;
+ union{
+ uint64_t slot_counter;
+ uint8_t slot_counter_s[8];
+ } __packed;
bool isValid() const { return !(slot_number & 0xF0); }
std::string dissect() const {