Replaced calls to strcpy() with memmove() where the strings overlapped, for

which case the behavior of strcpy() is undefined.


git-svn-id: svn://svn.code.sf.net/p/ctags/code/trunk@782 c5d04d22-be80-434c-894e-aa346cc9e8e8
This commit is contained in:
dhiebert 2012-03-26 02:35:57 +00:00
parent 548f42754d
commit d19a142f09
1 changed files with 2 additions and 2 deletions

View File

@ -757,13 +757,13 @@ extern char* absoluteFilename (const char *file)
else if (cp [0] != PATH_SEPARATOR)
cp = slashp;
#endif
strcpy (cp, slashp + 3);
memmove (cp, slashp + 3, strlen (slashp + 3) + 1);
slashp = cp;
continue;
}
else if (slashp [2] == PATH_SEPARATOR || slashp [2] == '\0')
{
strcpy (slashp, slashp + 2);
memmove (slashp, slashp + 2, strlen (slashp + 2) + 1);
continue;
}
}