Leaked source code of windows server 2003
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

98 lines
2.3 KiB

  1. /***
  2. *wcscat.c - contains wcscat() and wcscpy()
  3. *
  4. * Copyright (c) 1985-2001, Microsoft Corporation. All rights reserved.
  5. *
  6. *Purpose:
  7. * wcscat() appends one wchar_t string onto another.
  8. * wcscpy() copies one wchar_t string into another.
  9. *
  10. * wcscat() concatenates (appends) a copy of the source string to the
  11. * end of the destination string, returning the destination string.
  12. * Strings are wide-character strings.
  13. *
  14. * wcscpy() copies the source string to the spot pointed to be
  15. * the destination string, returning the destination string.
  16. * Strings are wide-character strings.
  17. *
  18. *Revision History:
  19. * 09-09-91 ETC Created from strcat.c.
  20. * 04-07-92 KRS Updated and ripped out _INTL switches.
  21. * 04-06-93 SKS Replace _CRTAPI* with __cdecl
  22. * 02-07-94 CFW POSIXify.
  23. *
  24. *******************************************************************************/
  25. #ifndef _POSIX_
  26. #include <cruntime.h>
  27. #include <string.h>
  28. #if defined(_M_IA64)
  29. #pragma warning(disable:4163)
  30. #pragma function(wcscpy, wcscat)
  31. #endif
  32. /***
  33. *wchar_t *wcscat(dst, src) - concatenate (append) one wchar_t string to another
  34. *
  35. *Purpose:
  36. * Concatenates src onto the end of dest. Assumes enough
  37. * space in dest.
  38. *
  39. *Entry:
  40. * wchar_t *dst - wchar_t string to which "src" is to be appended
  41. * const wchar_t *src - wchar_t string to be appended to the end of "dst"
  42. *
  43. *Exit:
  44. * The address of "dst"
  45. *
  46. *Exceptions:
  47. *
  48. *******************************************************************************/
  49. wchar_t * __cdecl wcscat (
  50. wchar_t * dst,
  51. const wchar_t * src
  52. )
  53. {
  54. wchar_t * cp = dst;
  55. while( *cp )
  56. cp++; /* find end of dst */
  57. while( *cp++ = *src++ ) ; /* Copy src to end of dst */
  58. return( dst ); /* return dst */
  59. }
  60. /***
  61. *wchar_t *wcscpy(dst, src) - copy one wchar_t string over another
  62. *
  63. *Purpose:
  64. * Copies the wchar_t string src into the spot specified by
  65. * dest; assumes enough room.
  66. *
  67. *Entry:
  68. * wchar_t * dst - wchar_t string over which "src" is to be copied
  69. * const wchar_t * src - wchar_t string to be copied over "dst"
  70. *
  71. *Exit:
  72. * The address of "dst"
  73. *
  74. *Exceptions:
  75. *******************************************************************************/
  76. wchar_t * __cdecl wcscpy(wchar_t * dst, const wchar_t * src)
  77. {
  78. wchar_t * cp = dst;
  79. while( *cp++ = *src++ )
  80. ; /* Copy src over dst */
  81. return( dst );
  82. }
  83. #endif /* _POSIX_ */