Permalink
Browse files

Replaced calls to strcpy() with memmove() where the strings overlappe…

…d, for

which case the behavior of strcpy() is undefined.
  • Loading branch information...
1 parent d437fbe commit 3b3e41bdc3b1cc590fcc942be47d185d208455a6 Darren Hiebert committed Mar 26, 2012
Showing with 2 additions and 2 deletions.
  1. +2 −2 routines.c
View
@@ -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;
}
}

0 comments on commit 3b3e41b

Please sign in to comment.