aboutsummaryrefslogtreecommitdiff
path: root/gdb/cli
diff options
context:
space:
mode:
Diffstat (limited to 'gdb/cli')
-rw-r--r--gdb/cli/cli-cmds.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gdb/cli/cli-cmds.c b/gdb/cli/cli-cmds.c
index 7513ee4..2968662 100644
--- a/gdb/cli/cli-cmds.c
+++ b/gdb/cli/cli-cmds.c
@@ -417,7 +417,7 @@ cd_command (char *dir, int from_tty)
{
if (IS_DIR_SEPARATOR (p[0]) && p[1] == '.'
&& (p[2] == 0 || IS_DIR_SEPARATOR (p[2])))
- strcpy (p, p + 2);
+ memmove (p, p + 2, strlen (p + 2) + 1);
else if (IS_DIR_SEPARATOR (p[0]) && p[1] == '.' && p[2] == '.'
&& (p[3] == 0 || IS_DIR_SEPARATOR (p[3])))
{
@@ -436,7 +436,7 @@ cd_command (char *dir, int from_tty)
++p;
else
{
- strcpy (q - 1, p + 3);
+ memmove (q - 1, p + 3, strlen (p + 3) + 1);
p = q - 1;
}
}