From 997d1c9f5f30992eab02a82891e29cb5ae47fb15 Mon Sep 17 00:00:00 2001 From: probonopd Date: Sat, 26 Feb 2022 09:44:13 +0100 Subject: [PATCH] Use 'char buf_name[11];' and 'setName()' https://github.com/probonopd/MiniDexed/issues/11#issuecomment-1051315444 Thanks @rsta2 --- src/minidexed.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/minidexed.cpp b/src/minidexed.cpp index d5147da..c522300 100644 --- a/src/minidexed.cpp +++ b/src/minidexed.cpp @@ -139,8 +139,8 @@ void CMiniDexed::MIDIPacketHandler (unsigned nCable, u8 *pPacket, unsigned nLeng printf ("Loading voice %d\n", (unsigned) pPacket[1]); s_pThis->loadVoiceParameters(voices_bank[0][(unsigned) pPacket[1]]); // FIXME: The following 3 lines do not work yet - char* buf_name = new char[11]; - s_pThis->getName(buf_name); + char buf_name[11]; + s_pThis->setName(buf_name); printf ("%s\n", buf_name); return; }