ReactOS 0.4.16-dev-974-g5022a45
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
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}
#define __cdecl
Definition: accygwin.h:79
unsigned char
Definition: typeof.h:29
GLuint start
Definition: gl.h:1545
GLuint GLuint GLsizei count
Definition: gl.h:1545
GLuint GLfloat * val
Definition: glext.h:7180
char string[160]
Definition: util.h:11
_strnset
Definition: string.h:393