aboutsummaryrefslogtreecommitdiff
path: root/gdb/source.c
diff options
context:
space:
mode:
authorTom Tromey <tromey@redhat.com>2012-03-16 18:20:34 +0000
committerTom Tromey <tromey@redhat.com>2012-03-16 18:20:34 +0000
commite16edb4530709c015a185c85c5f501552c4b41d8 (patch)
tree2b41314cca4fec42a9c08eea9d9ac1591ec5a891 /gdb/source.c
parent53ba833325bbe3d1742879d6b43407e783985a29 (diff)
downloadgdb-e16edb4530709c015a185c85c5f501552c4b41d8.zip
gdb-e16edb4530709c015a185c85c5f501552c4b41d8.tar.gz
gdb-e16edb4530709c015a185c85c5f501552c4b41d8.tar.bz2
2012-03-16 Chris January <chris.january@allinea.com>
* source.c (add_path): Use memmove instead of strcpy because the strings overlap.
Diffstat (limited to 'gdb/source.c')
-rw-r--r--gdb/source.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/gdb/source.c b/gdb/source.c
index cfdf81b..97f5d46 100644
--- a/gdb/source.c
+++ b/gdb/source.c
@@ -588,7 +588,7 @@ add_path (char *dirname, char **which_path, int parse_separators)
p--; /* Back over leading separator. */
if (prefix > p - *which_path)
goto skip_dup; /* Same dir twice in one cmd. */
- strcpy (p, &p[len + 1]); /* Copy from next \0 or : */
+ memmove (p, &p[len + 1], strlen (&p[len + 1]) + 1); /* Copy from next \0 or : */
}
p = strchr (p, DIRNAME_SEPARATOR);
if (p != 0)