* string/stpcpy.c (__stpcpy): Rewrite using strlen and memcpy.
This commit is contained in:
parent
7d81e8d6db
commit
f559d8cf29
|
@ -1,3 +1,7 @@
|
||||||
|
2014-12-23 Richard Earnshaw <rearnsha@arm.com>
|
||||||
|
|
||||||
|
* string/stpcpy.c (__stpcpy): Rewrite using strlen and memcpy.
|
||||||
|
|
||||||
2014-12-23 Florian Weimer <fweimer@redhat.com>
|
2014-12-23 Florian Weimer <fweimer@redhat.com>
|
||||||
|
|
||||||
* iconvdata/run-iconv-test.sh: Actually test iconv modules.
|
* iconvdata/run-iconv-test.sh: Actually test iconv modules.
|
||||||
|
|
|
@ -35,14 +35,8 @@ __stpcpy (dest, src)
|
||||||
char *dest;
|
char *dest;
|
||||||
const char *src;
|
const char *src;
|
||||||
{
|
{
|
||||||
char *d = dest;
|
size_t len = strlen (src);
|
||||||
const char *s = src;
|
return memcpy (dest, src, len + 1) + len;
|
||||||
|
|
||||||
do
|
|
||||||
*d++ = *s;
|
|
||||||
while (*s++ != '\0');
|
|
||||||
|
|
||||||
return d - 1;
|
|
||||||
}
|
}
|
||||||
#ifdef libc_hidden_def
|
#ifdef libc_hidden_def
|
||||||
libc_hidden_def (__stpcpy)
|
libc_hidden_def (__stpcpy)
|
||||||
|
|
Loading…
Reference in New Issue