Back to index

glibc  2.9
Functions
wcscat.c File Reference
#include <wchar.h>

Go to the source code of this file.

Functions

wchar_t * __wcscat (wchar_t *dest, const wchar_t *src)

Function Documentation

wchar_t* __wcscat ( wchar_t *  dest,
const wchar_t *  src 
)

Definition at line 25 of file wcscat.c.

{
  register wchar_t *s1 = dest;
  register const wchar_t *s2 = src;
  wchar_t c;

  /* Find the end of the string.  */
  do
    c = *s1++;
  while (c != L'\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 != L'\0');

  return dest;
}