From c591526cdb802774ca85e8e2e02503c604b7f16a Mon Sep 17 00:00:00 2001 From: Matt Date: Wed, 2 Oct 2024 12:27:19 -0700 Subject: [PATCH] fix string overlapping in debugger command handling --- src/mamedbg.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/mamedbg.c b/src/mamedbg.c index 33e58bdc3..f54dc431d 100644 --- a/src/mamedbg.c +++ b/src/mamedbg.c @@ -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 ) @@ -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; } }