source: trunk/libs/newlib/src/newlib/libc/string/wcpcpy.c @ 567

Last change on this file since 567 was 444, checked in by satin@…, 6 years ago

add newlib,libalmos-mkh, restructure shared_syscalls.h and mini-libc

File size: 813 bytes
Line 
1/*
2FUNCTION
3        <<wcpcpy>>---copy a wide-character string returning a pointer to its end
4
5SYNOPSIS
6        #include <wchar.h>
7        wchar_t *wcpcpy(wchar_t *<[s1]>, const wchar_t *<[s2]>);
8
9DESCRIPTION
10        The <<wcpcpy>> function copies the wide-character string pointed to by
11        <[s2]> (including the terminating null wide-character code) into the
12        array pointed to by <[s1]>. If copying takes place between objects that
13        overlap, the behaviour is undefined.
14
15RETURNS
16        This function returns a pointer to the end of the destination string,
17        thus pointing to the trailing '\0'.
18
19PORTABILITY
20<<wcpcpy>> is a GNU extension.
21
22No supporting OS subroutines are required.
23*/
24
25#include <_ansi.h>
26#include <wchar.h>
27
28wchar_t *
29wcpcpy (wchar_t *__restrict s1,
30        const wchar_t *__restrict s2)
31{
32  while ((*s1++ = *s2++))
33    ;
34  return --s1;
35}
Note: See TracBrowser for help on using the repository browser.