summaryrefslogtreecommitdiff
path: root/src/key.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2019-04-08 21:14:19 +0100
committerCarl Hetherington <cth@carlh.net>2019-04-08 21:14:19 +0100
commitd9d117d8dd56322fed12f8e12c574cf08fe22500 (patch)
treea10caad60c43a8adb58b56a694681306f1236919 /src/key.cc
parentb785a1a76e0863fc98d0acc98a098d328929d493 (diff)
Fix previous and add unit test for Key::hex.
Diffstat (limited to 'src/key.cc')
-rw-r--r--src/key.cc5
1 files changed, 3 insertions, 2 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;
}