summaryrefslogtreecommitdiff
path: root/src/key.cc
diff options
context:
space:
mode:
Diffstat (limited to 'src/key.cc')
-rw-r--r--src/key.cc6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/key.cc b/src/key.cc
index a5e92aac..f11f6323 100644
--- a/src/key.cc
+++ b/src/key.cc
@@ -108,9 +108,9 @@ Key::operator= (Key const & other)
string
Key::hex () const
{
- char buffer[_length * 2 + 1];
+ std::vector<char> buffer(_length * 2 + 1);
- char* p = buffer;
+ char* p = buffer.data();
for (int i = 0; i < _length; ++i) {
#ifdef LIBDCP_WINDOWS
__mingw_snprintf (p, 3, "%02hhx", _value[i]);
@@ -120,7 +120,7 @@ Key::hex () const
p += 2;
}
- return buffer;
+ return string(buffer.data());
}