2012-03-16 Chris January <chris.january@allinea.com>
* source.c (add_path): Use memmove instead of strcpy because the strings overlap.
This commit is contained in:
parent
53ba833325
commit
e16edb4530
2 changed files with 6 additions and 1 deletions
|
@ -1,3 +1,8 @@
|
|||
2012-03-16 Chris January <chris.january@allinea.com>
|
||||
|
||||
* source.c (add_path): Use memmove instead of strcpy because the
|
||||
strings overlap.
|
||||
|
||||
2012-03-16 Joel Brobecker <brobecker@adacore.com>
|
||||
|
||||
* value.h (set_value_parent): Add declaration.
|
||||
|
|
|
@ -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)
|
||||
|
|
Loading…
Reference in a new issue