mirror of
https://github.com/reactos/reactos.git
synced 2025-08-03 19:55:41 +00:00
[UCRT] Import Microsoft.Windows.SDK.CRTSource version 10.0.22621.3
Imported from https://www.nuget.org/packages/Microsoft.Windows.SDK.CRTSource/10.0.22621.3 License: MIT
This commit is contained in:
parent
f1b60c66f0
commit
04e0dc4a7a
568 changed files with 115483 additions and 0 deletions
48
sdk/lib/ucrt/string/memccpy.c
Normal file
48
sdk/lib/ucrt/string/memccpy.c
Normal file
|
@ -0,0 +1,48 @@
|
|||
/***
|
||||
*memccpy.c - copy bytes until a character is found
|
||||
*
|
||||
* Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
*
|
||||
*Purpose:
|
||||
* defines _memccpy() - copies bytes until a specifed character
|
||||
* is found, or a maximum number of characters have been copied.
|
||||
*
|
||||
*******************************************************************************/
|
||||
|
||||
#include <string.h>
|
||||
|
||||
/***
|
||||
*char *_memccpy(dest, src, c, count) - copy bytes until character found
|
||||
*
|
||||
*Purpose:
|
||||
* Copies bytes from src to dest until count bytes have been
|
||||
* copied, or up to and including the character c, whichever
|
||||
* comes first.
|
||||
*
|
||||
*Entry:
|
||||
* void *dest - pointer to memory to receive copy
|
||||
* void *src - source of bytes
|
||||
* int c - character to stop copy at
|
||||
* size_t count - max number of bytes to copy
|
||||
*
|
||||
*Exit:
|
||||
* returns pointer to byte immediately after c in dest
|
||||
* returns NULL if c was never found
|
||||
*
|
||||
*Exceptions:
|
||||
*
|
||||
*******************************************************************************/
|
||||
|
||||
void * __cdecl _memccpy (
|
||||
void * dest,
|
||||
const void * src,
|
||||
int c,
|
||||
size_t count
|
||||
)
|
||||
{
|
||||
while ( count && (*((char *)(dest = (char *)dest + 1) - 1) =
|
||||
*((char *)(src = (char *)src + 1) - 1)) != (char)c )
|
||||
count--;
|
||||
|
||||
return(count ? dest : NULL);
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue