From 0f2965f5808386f9dd89209d754fd827ef2b27bd Mon Sep 17 00:00:00 2001 From: Szczepan Zalega Date: Tue, 9 Aug 2016 13:41:11 +0200 Subject: Small fixes Signed-off-by: Szczepan Zalega --- NitrokeyManager.cc | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc index 356fde3..5baf7bd 100644 --- a/NitrokeyManager.cc +++ b/NitrokeyManager.cc @@ -9,7 +9,7 @@ namespace nitrokey{ void strcpyT(T& dest, const char* src){ assert(src != nullptr); const size_t s = sizeof dest; - assert(strlen(src) <= s); + assert(strlen(src) <= s); // FIXME should throw an exception to abort when too long string appears strncpy((char*) &dest, src, s); } @@ -42,7 +42,7 @@ namespace nitrokey{ bool NitrokeyManager::connect() { device = nullptr; vector< shared_ptr > devices = { make_shared(), make_shared() }; - for( auto d : devices ){ + for( auto & d : devices ){ if (d->connect()){ device = std::shared_ptr(d); } -- cgit v1.2.3