sl@0: /*
sl@0: * Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
sl@0: * All rights reserved.
sl@0: * This component and the accompanying materials are made available
sl@0: * under the terms of "Eclipse Public License v1.0"
sl@0: * which accompanies this distribution, and is available
sl@0: * at the URL "http://www.eclipse.org/legal/epl-v10.html".
sl@0: *
sl@0: * Initial Contributors:
sl@0: * Nokia Corporation - initial contribution.
sl@0: *
sl@0: * Contributors:
sl@0: *
sl@0: * Description:
sl@0: * FUNCTION
sl@0: * <<strcat>>---concatenate strings
sl@0: * INDEX
sl@0: * strcat
sl@0: * ANSI_SYNOPSIS
sl@0: * #include <string.h>
sl@0: * char *strcat(char *<[dst]>, const char *<[src]>);
sl@0: * TRAD_SYNOPSIS
sl@0: * #include <string.h>
sl@0: * char *strcat(<[dst]>, <[src]>)
sl@0: * char *<[dst]>;
sl@0: * char *<[src]>;
sl@0: * <<strcat>> appends a copy of the string pointed to by <[src]>
sl@0: * (including the terminating null character) to the end of the
sl@0: * string pointed to by <[dst]>.  The initial character of
sl@0: * <[src]> overwrites the null character at the end of <[dst]>.
sl@0: * RETURNS
sl@0: * This function returns the initial value of <[dst]>
sl@0: * PORTABILITY
sl@0: * <<strcat>> is ANSI C.
sl@0: * <<strcat>> requires no supporting OS subroutines.
sl@0: * QUICKREF
sl@0: * strcat ansi pure
sl@0: * 
sl@0: *
sl@0: */
sl@0: 
sl@0: 
sl@0: 
sl@0: #include <string.h>
sl@0: 
sl@0: /*SUPPRESS 560*/
sl@0: /*SUPPRESS 530*/
sl@0: 
sl@0: /**
sl@0: Append string.
sl@0: Appends s2 string to s1 string. 
sl@0: The terminating null character in s1 is overwritten by the first character of s2.
sl@0: The resulting string includes a null-character at end.
sl@0: @return s1.
sl@0: @param s1 Pointer to a null-terminated string with enough space allocated to 
sl@0: contain both s2 and s1. 
sl@0: @param s2 Null-terminated string to append.
sl@0: */
sl@0: EXPORT_C char * strcat (char *s1, const char *s2)
sl@0: {
sl@0:   char *s = s1;
sl@0: 
sl@0:   while (*s1)
sl@0:     s1++;
sl@0: 
sl@0:   while ((*s1++ = *s2++)!=0)
sl@0:     ;
sl@0:   return s;
sl@0: }
sl@0: 
sl@0: /**
sl@0: Append a copy of the wide-character string pointed to by s2
sl@0: @return s1
sl@0: @param s1 wide-character
sl@0: @param s2 wide-character
sl@0: */
sl@0: EXPORT_C wchar_t * wcscat (wchar_t *s1, const wchar_t *s2)
sl@0: {
sl@0:   wchar_t *s = s1;
sl@0: 
sl@0:   while (*s1)
sl@0:     s1++;
sl@0: 
sl@0:   while ((*s1++ = *s2++)!=L'\0')
sl@0:     ;
sl@0:   return s;
sl@0: }