aboutsummaryrefslogtreecommitdiff
path: root/NitrokeyManager.cc
diff options
context:
space:
mode:
authorSzczepan Zalega <szczepan@nitrokey.com>2016-08-09 13:41:11 +0200
committerSzczepan Zalega <szczepan@nitrokey.com>2016-08-09 18:34:00 +0200
commit0f2965f5808386f9dd89209d754fd827ef2b27bd (patch)
treef28068cc2aa2cf86d3d3e21af2a9fba7a97013c4 /NitrokeyManager.cc
parentb6da7f29414fc07d2670de97f164abe664143c8a (diff)
downloadlibnitrokey-0f2965f5808386f9dd89209d754fd827ef2b27bd.tar.gz
libnitrokey-0f2965f5808386f9dd89209d754fd827ef2b27bd.tar.bz2
Small fixes
Signed-off-by: Szczepan Zalega <szczepan@nitrokey.com>
Diffstat (limited to 'NitrokeyManager.cc')
-rw-r--r--NitrokeyManager.cc4
1 files 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<Device> > devices = { make_shared<Stick10>(), make_shared<Stick20>() };
- for( auto d : devices ){
+ for( auto & d : devices ){
if (d->connect()){
device = std::shared_ptr<Device>(d);
}