aboutsummaryrefslogtreecommitdiff
path: root/string/strncat.c
diff options
context:
space:
mode:
Diffstat (limited to 'string/strncat.c')
-rw-r--r--string/strncat.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/string/strncat.c b/string/strncat.c
index 7ac44561bd..6d29114d38 100644
--- a/string/strncat.c
+++ b/string/strncat.c
@@ -33,13 +33,11 @@ STRNCAT (char *s1, const char *s2, size_t n)
char *s = s1;
/* Find the end of S1. */
- do
- c = *s1++;
- while (c != '\0');
+ s1 += strlen (s1);
/* Make S1 point before next character, so we can increment
it while memory is read (wins on pipelined cpus). */
- s1 -= 2;
+ s1 -= 1;
if (n >= 4)
{