ReactOS 0.4.15-dev-7918-g2a2556c
mbsset.c
Go to the documentation of this file.
1/*
2 * COPYRIGHT: See COPYING in the top level directory
3 * PROJECT: ReactOS system libraries
4 * FILE: lib/sdk/crt/mbstring/mbsset.c
5 * PURPOSE: Fills a string with a multibyte character
6 * PROGRAMER: Ariadne
7 * UPDATE HISTORY:
8 * 12/04/99: Created
9 */
10
11#include <mbstring.h>
12
13size_t _mbclen2(const unsigned int s);
14
15/*
16 * @implemented
17 */
18unsigned char * _mbsset(unsigned char *src, unsigned int c)
19{
20 unsigned char *char_src = src;
21 unsigned short *short_src = (unsigned short *)src;
22
23 if ( _mbclen2(c) == 1 ) {
24
25 while(*char_src != 0) {
26 *char_src = c;
27 char_src++;
28 }
29 *char_src = 0;
30 }
31 else {
32 while(*short_src != 0) {
33 *short_src = c;
34 short_src++;
35 }
36 *short_src = 0;
37 }
38
39 return src;
40}
GLdouble s
Definition: gl.h:2039
GLenum src
Definition: glext.h:6340
const GLubyte * c
Definition: glext.h:8905
#define c
Definition: ke_i.h:80
size_t _mbclen2(const unsigned int s)
Definition: mbclen.c:23
unsigned char * _mbsset(unsigned char *src, unsigned int c)
Definition: mbsset.c:18