Merge pull request #4 from tschiemer/master
[libdcp.git] / src / key.cc
index 58cc6d5443d4ec863a214b81f7345cc644914273..6fc075cbcf5240057d5b8e1cfe8fe46e933e2356 100644 (file)
@@ -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;
        }