Skip to content

Commit

Permalink
fix string overlapping in debugger command handling
Browse files Browse the repository at this point in the history
  • Loading branch information
mattwalsh committed Oct 2, 2024
1 parent 1a2f0a1 commit c591526
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/mamedbg.c
Original file line number Diff line number Diff line change
Expand Up @@ -3506,7 +3506,7 @@ static int edit_cmds_parse( char *cmdline )
if( !strncmp( cmdline, commands[i].name, l ) && !isalnum( cmdline[l] ) )
{
while( cmdline[l] && isspace( cmdline[l] ) ) l++;
strcpy( cmdline, cmdline + l );
memmove( cmdline, cmdline + l, strlen(cmdline+l) + 1);
return i;
}
if( commands[i].alias )
Expand All @@ -3515,7 +3515,7 @@ static int edit_cmds_parse( char *cmdline )
if( !strncmp( cmdline, commands[i].alias, l ) && !isalnum( cmdline[l] ) )
{
while( cmdline[l] && isspace( cmdline[l] ) ) l++;
strcpy( cmdline, cmdline + l );
memmove( cmdline, cmdline + l, strlen(cmdline+l) + 1);
return i;
}
}
Expand Down

0 comments on commit c591526

Please sign in to comment.