}
void
-sim_do_command (SIM_DESC sd, char *cmd)
+sim_do_command (SIM_DESC sd, const char *cmd)
{
- check_desc (sd);
+ const char *args;
+ char *p = strdup (cmd);
- char *p = cmd;
+ check_desc (sd);
/* Skip leading whitespace. */
while (isspace (*p))
/* Null-terminate the command word, and record the start of any
further arguments. */
- char *args;
if (*p)
{
*p = '\0';
else
printf ("The 'sim' command expects either 'trace' or 'verbose'"
" as a subcommand.\n");
+
+ free (p);
}
char **