mirror of
https://github.com/MidnightCommander/mc
synced 2024-12-22 20:36:50 +03:00
Ticket #2018: strcpy() is used for overlaping strings.
memmove() is used for overlaping strings instead of strcpy(). Signed-off-by: Andrew Borodin <aborodin@vmail.ru>
This commit is contained in:
parent
25c0ed72e8
commit
68ecccb453
@ -218,8 +218,9 @@ ftpfs_translate_path (struct vfs_class *me, struct vfs_s_super *super, const cha
|
||||
ret = g_strdup (remote_path);
|
||||
|
||||
/* replace first occurance of ":/" with ":" */
|
||||
if ((p = strchr (ret, ':')) && *(p + 1) == '/')
|
||||
strcpy (p + 1, p + 2);
|
||||
p = strchr (ret, ':');
|
||||
if ((p != NULL) && (*(p + 1) == '/'))
|
||||
memmove (p + 1, p + 2, strlen (p + 2) + 1);
|
||||
|
||||
/* strip trailing "/." */
|
||||
if ((p = strrchr (ret, '/')) && *(p + 1) == '.' && *(p + 2) == '\0')
|
||||
|
Loading…
Reference in New Issue
Block a user