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

4
scp.c
View file

@ -7727,10 +7727,14 @@ 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)
{ {
if (action) {
sim_brk_act_buf[sim_do_depth] = realloc (sim_brk_act_buf[sim_do_depth], strlen (action) + 1); sim_brk_act_buf[sim_do_depth] = realloc (sim_brk_act_buf[sim_do_depth], strlen (action) + 1);
strcpy (sim_brk_act_buf[sim_do_depth], action); strcpy (sim_brk_act_buf[sim_do_depth], action);
sim_brk_act[sim_do_depth] = sim_brk_act_buf[sim_do_depth]; sim_brk_act[sim_do_depth] = sim_brk_act_buf[sim_do_depth];
} }
else
sim_brk_clract ();
}
/* New PC */ /* New PC */