aboutsummaryrefslogtreecommitdiff
path: root/string/stpcpy.c
diff options
context:
space:
mode:
Diffstat (limited to 'string/stpcpy.c')
-rw-r--r--string/stpcpy.c10
1 files changed, 2 insertions, 8 deletions
diff --git a/string/stpcpy.c b/string/stpcpy.c
index 9185acc..fd6eb1c 100644
--- a/string/stpcpy.c
+++ b/string/stpcpy.c
@@ -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)