Reactos
1//
2// wcsnset.cpp
3//
4// Copyright (c) Microsoft Corporation. All rights reserved.
5//
6// Defines _wcsnset(), which sets all of the characters of a null-terminated
7// string to the given character. This function sets at most 'count' characters.
8//
9#include <string.h>
10
11
12
13extern "C" wchar_t* __cdecl _wcsnset(
14 wchar_t* const string,
15 wchar_t const value,
16 size_t const count
17 )
18{
19 wchar_t* it = string;
20 for (size_t i = 0; i != count && *it; ++i, ++it)
21 {
22 *it = value;
23 }
24
25 return string;
26}