Skip to content

Commit

Permalink
Merge pull request #336 from mattwalsh/fix_str_overlap
Browse files Browse the repository at this point in the history
fix string overlapping in debugger command handling
  • Loading branch information
toxieainc authored Oct 3, 2024
2 parents 1a2f0a1 + c591526 commit 82ac61e
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 82ac61e

Please sign in to comment.