From 729c00f6fec0df21e9e89ab357864a0412b9c14c Mon Sep 17 00:00:00 2001 From: Daniel Loffgren Date: Mon, 8 Feb 2016 09:25:32 +0000 Subject: [PATCH] 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 --- apple1/main.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/apple1/main.c b/apple1/main.c index 3d76fed..376dfde 100644 --- a/apple1/main.c +++ b/apple1/main.c @@ -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");