diff options
author | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
---|---|---|
committer | Adam <you@example.com> | 2020-05-17 05:51:50 +0200 |
commit | e611b132f9b8abe35b362e5870b74bce94a1e58e (patch) | |
tree | a5781d2ec0e085eeca33cf350cf878f2efea6fe5 /private/crt32/string/wcscat.c | |
download | NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.gz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.bz2 NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.lz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.xz NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.tar.zst NT4.0-e611b132f9b8abe35b362e5870b74bce94a1e58e.zip |
Diffstat (limited to 'private/crt32/string/wcscat.c')
-rw-r--r-- | private/crt32/string/wcscat.c | 87 |
1 files changed, 87 insertions, 0 deletions
diff --git a/private/crt32/string/wcscat.c b/private/crt32/string/wcscat.c new file mode 100644 index 000000000..925492aa3 --- /dev/null +++ b/private/crt32/string/wcscat.c @@ -0,0 +1,87 @@ +/*** +*wcscat.c - contains wcscat() and wcscpy() +* +* Copyright (c) 1985-1992, Microsoft Corporation. All rights reserved. +* +*Purpose: +* wcscat() appends one wchar_t string onto another. +* wcscpy() copies one wchar_t string into another. +* +* wcscat() concatenates (appends) a copy of the source string to the +* end of the destination string, returning the destination string. +* Strings are wide-character strings. +* +* wcscpy() copies the source string to the spot pointed to be +* the destination string, returning the destination string. +* Strings are wide-character strings. +* +*Revision History: +* 09-09-91 ETC Created from strcat.c. +* 04-07-92 KRS Updated and ripped out _INTL switches. +* +*******************************************************************************/ + +#include <cruntime.h> +#include <string.h> + +/*** +*wchar_t *wcscat(dst, src) - concatenate (append) one wchar_t string to another +* +*Purpose: +* Concatenates src onto the end of dest. Assumes enough +* space in dest. +* +*Entry: +* wchar_t *dst - wchar_t string to which "src" is to be appended +* const wchar_t *src - wchar_t string to be appended to the end of "dst" +* +*Exit: +* The address of "dst" +* +*Exceptions: +* +*******************************************************************************/ + +wchar_t * _CALLTYPE1 wcscat ( + wchar_t * dst, + const wchar_t * src + ) +{ + wchar_t * cp = dst; + + while( *cp ) + cp++; /* find end of dst */ + + while( *cp++ = *src++ ) ; /* Copy src to end of dst */ + + return( dst ); /* return dst */ + +} + + +/*** +*wchar_t *wcscpy(dst, src) - copy one wchar_t string over another +* +*Purpose: +* Copies the wchar_t string src into the spot specified by +* dest; assumes enough room. +* +*Entry: +* wchar_t * dst - wchar_t string over which "src" is to be copied +* const wchar_t * src - wchar_t string to be copied over "dst" +* +*Exit: +* The address of "dst" +* +*Exceptions: +*******************************************************************************/ + +wchar_t * _CALLTYPE1 wcscpy(wchar_t * dst, const wchar_t * src) +{ + wchar_t * cp = dst; + + while( *cp++ = *src++ ) + ; /* Copy src over dst */ + + return( dst ); +} |