From b863d2bc4db728213e54ff502d2c3ae5dfa0db25 Mon Sep 17 00:00:00 2001 From: Wilco Dijkstra Date: Mon, 24 Nov 2014 15:09:07 +0000 Subject: Improve strcpy performance. --- string/strcpy.c | 13 +------------ 1 file changed, 1 insertion(+), 12 deletions(-) (limited to 'string') diff --git a/string/strcpy.c b/string/strcpy.c index caa234a691..91f9cc640e 100644 --- a/string/strcpy.c +++ b/string/strcpy.c @@ -24,17 +24,6 @@ char * strcpy (char *dest, const char *src) { - char c; - char *s = (char *) src; - const ptrdiff_t off = dest - s - 1; - - do - { - c = *s++; - s[off] = c; - } - while (c != '\0'); - - return dest; + return memcpy (dest, src, strlen (src) + 1)); } libc_hidden_builtin_def (strcpy) -- cgit v1.2.1