Back to index

glibc  2.9
Functions
strcat.c File Reference
#include <string.h>
#include <memcopy.h>

Go to the source code of this file.

Functions

char * strcat (char *dest, const char *src)

Function Documentation

char* strcat ( char *  dest,
const char *  src 
)

Definition at line 26 of file strcat.c.

{
  char *s1 = dest;
  const char *s2 = src;
  reg_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');

  return dest;
}

Here is the caller graph for this function: