SCP: Fix recently revised breakpoint setup to behave properly breakpoint action is NULL

This commit is contained in:
Mark Pizzolato 2014-10-11 04:19:15 -07:00
parent 3951ad2432
commit d0865d37f5

10
scp.c
View file

@ -7727,9 +7727,13 @@ return sim_brk_act[sim_do_depth] = sim_brk_act_buf[sim_do_depth] = NULL;
void sim_brk_setact (const char *action) void sim_brk_setact (const char *action)
{ {
sim_brk_act_buf[sim_do_depth] = realloc (sim_brk_act_buf[sim_do_depth], strlen (action) + 1); if (action) {
strcpy (sim_brk_act_buf[sim_do_depth], action); sim_brk_act_buf[sim_do_depth] = realloc (sim_brk_act_buf[sim_do_depth], strlen (action) + 1);
sim_brk_act[sim_do_depth] = sim_brk_act_buf[sim_do_depth]; strcpy (sim_brk_act_buf[sim_do_depth], action);
sim_brk_act[sim_do_depth] = sim_brk_act_buf[sim_do_depth];
}
else
sim_brk_clract ();
} }
/* New PC */ /* New PC */