summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--NitrokeyManager.cc8
1 files changed, 2 insertions, 6 deletions
diff --git a/NitrokeyManager.cc b/NitrokeyManager.cc
index d46b718..2a0033f 100644
--- a/NitrokeyManager.cc
+++ b/NitrokeyManager.cc
@@ -7,14 +7,10 @@ namespace nitrokey{
template <typename T>
void strcpyT(T& dest, const char* src){
const int s = sizeof dest;
-// strcpy((char*) &dest, src);
- memcpy(&dest, src, s);
- dest[s-1] = 0;
+ assert(strlen(src) <= s);
+ strncpy((char*) &dest, src, s);
}
-// template <typename T>
-// void initialize(T& st){ bzero(&st, sizeof(st)); }
-
template <typename T>
typename T::CommandPayload get_payload(){
//Create, initialize and return by value command payload