diff --git a/sim/rx/ChangeLog b/sim/rx/ChangeLog index f064039582..8d5f1d745e 100644 --- a/sim/rx/ChangeLog +++ b/sim/rx/ChangeLog @@ -1,3 +1,7 @@ +2021-02-08 Andrew Burgess + + * gdb-if.c (sim_do_command): Work with a copy of the command. + 2021-02-08 Andrew Burgess * gdb-if.c (sim_memory_map): New function. diff --git a/sim/rx/gdb-if.c b/sim/rx/gdb-if.c index 6f8bfbd1c5..55eb13d12e 100644 --- a/sim/rx/gdb-if.c +++ b/sim/rx/gdb-if.c @@ -804,13 +804,13 @@ sim_do_command (SIM_DESC sd, const char *cmd) p++; /* Find the extent of the command word. */ - for (p = cmd; *p; p++) + for (; *p != '\0'; p++) if (isspace (*p)) break; /* Null-terminate the command word, and record the start of any further arguments. */ - if (*p) + if (*p != '\0') { *p = '\0'; args = p + 1;