1
0
mirror of https://sourceware.org/git/glibc.git synced 2025-07-28 00:21:52 +03:00

* string/stpcpy.c (__stpcpy): Rewrite using strlen and memcpy.

This commit is contained in:
Richard Earnshaw
2014-12-23 08:57:07 -08:00
committed by Paul Eggert
parent 7d81e8d6db
commit f559d8cf29
2 changed files with 6 additions and 8 deletions

View File

@ -35,14 +35,8 @@ __stpcpy (dest, src)
char *dest;
const char *src;
{
char *d = dest;
const char *s = src;
do
*d++ = *s;
while (*s++ != '\0');
return d - 1;
size_t len = strlen (src);
return memcpy (dest, src, len + 1) + len;
}
#ifdef libc_hidden_def
libc_hidden_def (__stpcpy)