From 7ff0040f3029777501ef9e0bf1f1eef7fb2ad358 Mon Sep 17 00:00:00 2001 From: Kevin Caccamo Date: Mon, 31 Jul 2017 10:44:23 -0400 Subject: [PATCH] Add a null pointer at the end of TimidityArgs This actually got the execvp call working consistently for me; now I can listen to MIDI music in GZDoom again. --- src/sound/mididevices/music_timiditypp_mididevice.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/sound/mididevices/music_timiditypp_mididevice.cpp b/src/sound/mididevices/music_timiditypp_mididevice.cpp index 27863a25c..254b840a0 100644 --- a/src/sound/mididevices/music_timiditypp_mididevice.cpp +++ b/src/sound/mididevices/music_timiditypp_mididevice.cpp @@ -558,7 +558,8 @@ bool TimidityPPMIDIDevice::LaunchTimidity () } strCount -= spaceInExePathCount; - char** TimidityArgs = new char*[strCount]; + char** TimidityArgs = new char*[strCount + 1]; + TimidityArgs[strCount] = NULL; spaceIdx = CommandLine.IndexOf(' '); int curSpace = spaceIdx, i = 1;