summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog4
-rw-r--r--string/strcat.c21
2 files changed, 5 insertions, 20 deletions
diff --git a/ChangeLog b/ChangeLog
index 98548cbaf9..f73c55e5d4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2014-10-24  Wilco Dijkstra  <wdijkstr@arm.com>
 
+	* string/strcat.c (strcat): Improve performance by using strlen/strcpy.
+
+2014-10-24  Wilco Dijkstra  <wdijkstr@arm.com>
+
 	* sysdeps/aarch64/fpu/fgetexcptflg.c (fegetexceptflag):
 	Call libc_fetestexcept_aarch64.
 
diff --git a/string/strcat.c b/string/strcat.c
index 2cbe8b32da..983d115707 100644
--- a/string/strcat.c
+++ b/string/strcat.c
@@ -23,26 +23,7 @@
 char *
 strcat (char *dest, const char *src)
 {
-  char *s1 = dest;
-  const char *s2 = src;
-  char c;
-
-  /* Find the end of the string.  */
-  do
-    c = *s1++;
-  while (c != '\0');
-
-  /* Make S1 point before the next character, so we can increment
-     it while memory is read (wins on pipelined cpus).  */
-  s1 -= 2;
-
-  do
-    {
-      c = *s2++;
-      *++s1 = c;
-    }
-  while (c != '\0');
-
+  strcpy (dest + strlen (dest), src);
   return dest;
 }
 libc_hidden_builtin_def (strcat)