ReactOS
0.4.16-dev-1946-g52006dd
strnset.c
Go to the documentation of this file.
1
/***
2
*strnset.c - set first n characters to single character
3
*
4
* Copyright (c) Microsoft Corporation. All rights reserved.
5
*
6
*Purpose:
7
* defines _strnset() - sets at most the first n characters of a string
8
* to a given character.
9
*
10
*******************************************************************************/
11
12
#include <string.h>
13
14
/***
15
*char *_strnset(string, val, count) - set at most count characters to val
16
*
17
*Purpose:
18
* Sets the first count characters of string the character value.
19
* If the length of string is less than count, the length of
20
* string is used in place of n.
21
*
22
*Entry:
23
* char *string - string to set characters in
24
* char val - character to fill with
25
* unsigned count - count of characters to fill
26
*
27
*Exit:
28
* returns string, now filled with count copies of val.
29
*
30
*Exceptions:
31
*
32
*******************************************************************************/
33
34
char
*
__cdecl
_strnset
(
35
char
*
string
,
36
int
val
,
37
size_t
count
38
)
39
{
40
char
*
start
=
string
;
41
42
while
(
count
-- && *
string
)
43
*
string
++ = (
char
)
val
;
44
45
return
(
start
);
46
}
__cdecl
#define __cdecl
Definition:
accygwin.h:79
char
unsigned char
Definition:
typeof.h:29
start
GLuint start
Definition:
gl.h:1545
count
GLuint GLuint GLsizei count
Definition:
gl.h:1545
val
GLuint GLfloat * val
Definition:
glext.h:7180
string
char string[160]
Definition:
util.h:11
_strnset
_strnset
Definition:
string.h:393
sdk
lib
ucrt
string
strnset.c
Generated on Thu Dec 4 2025 06:16:23 for ReactOS by
1.9.6