summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/key.cc5
-rw-r--r--src/key.h6
2 files changed, 6 insertions, 5 deletions
diff --git a/src/key.cc b/src/key.cc
index 58cc6d54..6fc075cb 100644
--- a/src/key.cc
+++ b/src/key.cc
@@ -90,6 +90,7 @@ Key::operator= (Key const & other)
return *this;
}
+ _length = other._length;
memcpy (_value, other._value, _length);
return *this;
}
@@ -102,9 +103,9 @@ Key::hex () const
char* p = buffer;
for (int i = 0; i < _length; ++i) {
#ifdef LIBDCP_WINDOWS
- __mingw_snprintf (p, 3, "%02hhx", buffer[i]);
+ __mingw_snprintf (p, 3, "%02hhx", _value[i]);
#else
- snprintf (p, 3, "%02hhx", buffer[i]);
+ snprintf (p, 3, "%02hhx", _value[i]);
#endif
p += 2;
}
diff --git a/src/key.h b/src/key.h
index 0464296f..690799f3 100644
--- a/src/key.h
+++ b/src/key.h
@@ -51,7 +51,7 @@ class Key
{
public:
/** Create a new, random key */
- Key (int length = ASDCP::KeyLen);
+ explicit Key (int length = ASDCP::KeyLen);
/** Create a Key from a raw key value */
explicit Key (uint8_t const *, int length = ASDCP::KeyLen);
@@ -60,10 +60,10 @@ public:
explicit Key (std::string);
Key (Key const &);
- ~Key ();
-
Key& operator= (Key const &);
+ ~Key ();
+
/** @return Raw key value */
uint8_t const * value () const {
return _value;