mirror of
https://github.com/ZDoom/qzdoom.git
synced 2024-11-11 15:22:16 +00:00
Null-terminate strings
This commit is contained in:
parent
ff35620a09
commit
a4370a3529
1 changed files with 2 additions and 0 deletions
|
@ -564,6 +564,7 @@ bool TimidityPPMIDIDevice::LaunchTimidity ()
|
|||
int curSpace = spaceIdx, i = 1;
|
||||
|
||||
TimidityArgs[0] = new char[TimidityExe.Len() + 1];
|
||||
TimidityArgs[0][TimidityExe.Len()] = 0;
|
||||
strcpy(TimidityArgs[0], TimidityExe.GetChars());
|
||||
|
||||
int argLen;
|
||||
|
@ -578,6 +579,7 @@ bool TimidityPPMIDIDevice::LaunchTimidity ()
|
|||
argLen = CommandLine.Len() - curSpace;
|
||||
}
|
||||
TimidityArgs[i] = new char[argLen];
|
||||
TimidityArgs[i][argLen-1] = 0;
|
||||
strcpy(TimidityArgs[i], CommandLine.Mid(spaceIdx, curSpace - spaceIdx).GetChars());
|
||||
i += 1;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue