reactos/lib/sdk/crt/string/strset.c
Timo Kreuzer a3623f23de [CRT]
- Make all x86assembly ML compatible
- Remove memcpy, it was duplicated from memmove, copy the label instead
- Guard some code against compilation on msvc, as these functions are intrinsics on MSVC and cannot be implemented
- Fix some x64 assembly (don't modify stack below rsp)

svn path=/branches/cmake-bringup/; revision=49421
2010-11-02 00:06:33 +00:00

56 lines
879 B
C

/*
* COPYRIGHT: See COPYING in the top level directory
* PROJECT: ReactOS system libraries
* FILE: lib/crt/strset.c
* PURPOSE: Implementation of _strnset and _strset
* PROGRAMER: Unknown
* UPDATE HISTORY:
* 25/11/05: Added license header
*/
#ifndef _MSC_VER
#if defined(__GNUC__) && !defined(__clang__)
#define __int64 long long
#endif
#ifdef _WIN64
typedef unsigned __int64 size_t;
#else
typedef unsigned int size_t;
#endif
/*
* @implemented
*/
char* _strnset(char* szToFill, int szFill, size_t sizeMaxFill)
{
char *t = szToFill;
int i = 0;
while (*szToFill != 0 && i < (int) sizeMaxFill)
{
*szToFill = szFill;
szToFill++;
i++;
}
return t;
}
/*
* @implemented
*/
char* _strset(char* szToFill, int szFill)
{
char *t = szToFill;
while (*szToFill != 0)
{
*szToFill = szFill;
szToFill++;
}
return t;
}
#endif