Source code of Windows XP (NT5)
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.

87 lines
2.1 KiB

  1. /***
  2. *wcscat.c - contains wcscat() and wcscpy()
  3. *
  4. * Copyright (c) 1985-1992, 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. *
  22. *******************************************************************************/
  23. #include <cruntime.h>
  24. #include <string.h>
  25. /***
  26. *wchar_t *wcscat(dst, src) - concatenate (append) one wchar_t string to another
  27. *
  28. *Purpose:
  29. * Concatenates src onto the end of dest. Assumes enough
  30. * space in dest.
  31. *
  32. *Entry:
  33. * wchar_t *dst - wchar_t string to which "src" is to be appended
  34. * const wchar_t *src - wchar_t string to be appended to the end of "dst"
  35. *
  36. *Exit:
  37. * The address of "dst"
  38. *
  39. *Exceptions:
  40. *
  41. *******************************************************************************/
  42. wchar_t * _CALLTYPE1 wcscat (
  43. wchar_t * dst,
  44. const wchar_t * src
  45. )
  46. {
  47. wchar_t * cp = dst;
  48. while( *cp )
  49. cp++; /* find end of dst */
  50. while( *cp++ = *src++ ) ; /* Copy src to end of dst */
  51. return( dst ); /* return dst */
  52. }
  53. /***
  54. *wchar_t *wcscpy(dst, src) - copy one wchar_t string over another
  55. *
  56. *Purpose:
  57. * Copies the wchar_t string src into the spot specified by
  58. * dest; assumes enough room.
  59. *
  60. *Entry:
  61. * wchar_t * dst - wchar_t string over which "src" is to be copied
  62. * const wchar_t * src - wchar_t string to be copied over "dst"
  63. *
  64. *Exit:
  65. * The address of "dst"
  66. *
  67. *Exceptions:
  68. *******************************************************************************/
  69. wchar_t * _CALLTYPE1 wcscpy(wchar_t * dst, const wchar_t * src)
  70. {
  71. wchar_t * cp = dst;
  72. while( *cp++ = *src++ )
  73. ; /* Copy src over dst */
  74. return( dst );
  75. }