Make sure not to trash the command pointer, otherwise realloc will fail

git-svn-id: svn+ssh://svn.phoenixbox.net/svn/apple1/trunk@83 64f78de7-aa59-e511-a0e8-0002a5492df0
This commit is contained in:
Daniel Loffgren 2016-02-08 09:25:32 +00:00
parent 822748228f
commit 729c00f6fe
1 changed files with 6 additions and 6 deletions

View File

@ -204,20 +204,20 @@ int main(int argc, const char * argv[])
// }
}
else if (v6502_compareDebuggerCommand(command, commandLen, "freeze")) {
command = trimheadtospc(command, commandLen);
char *trimmedCommand = trimheadtospc(command, commandLen);
if(command[0]) {
saveFreeze(pia, command);
if(trimmedCommand[0]) {
saveFreeze(pia, trimmedCommand);
}
else {
printf("A filename is required to save freeze.\n");
}
}
else if (v6502_compareDebuggerCommand(command, commandLen, "restore")) {
command = trimheadtospc(command, commandLen);
char *trimmedCommand = trimheadtospc(command, commandLen);
if(command[0]) {
loadFreeze(pia, command);
if(trimmedCommand[0]) {
loadFreeze(pia, trimmedCommand);
}
else {
printf("A filename is required to load freeze.\n");