summaryrefslogtreecommitdiff
path: root/src/key.cc
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2025-09-30 15:15:10 +0200
committerCarl Hetherington <cth@carlh.net>2025-09-30 15:15:10 +0200
commit22d9015d4788bca8da7113ad187f0b04cfbc4216 (patch)
treee7b8cd1dd19bfb0ea7eef937168cdd2aea29b454 /src/key.cc
parent63a81274aa1423ebb593cad9dfe0501853e1c1c5 (diff)
Fix some warnings raised by the macOS compiler.
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());
}