From d0865d37f5d48bcb9dd968b5e6db1ad2f9edbf28 Mon Sep 17 00:00:00 2001 From: Mark Pizzolato Date: Sat, 11 Oct 2014 04:19:15 -0700 Subject: [PATCH] SCP: Fix recently revised breakpoint setup to behave properly breakpoint action is NULL --- scp.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/scp.c b/scp.c index 00b0f309..f2cc4909 100644 --- a/scp.c +++ b/scp.c @@ -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) { -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); -sim_brk_act[sim_do_depth] = sim_brk_act_buf[sim_do_depth]; +if (action) { + 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); + sim_brk_act[sim_do_depth] = sim_brk_act_buf[sim_do_depth]; + } +else + sim_brk_clract (); } /* New PC */