blob: 3193ca328e34a0b94872392dc8a70766dbc96ef2 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
|
#include <string.h>
#include "_safety.h"
/** fill memory **/
errno_t memset_s(void *s, rsize_t smax, int c, rsize_t n)
{
SIGNAL_SAFE(0);
ASSERT_NONNULL(s);
DANGEROUS_WRITE(s, smax);
unsigned char *_s = (unsigned char *)s;
rsize_t i = 0;
while (i < n && i < smax) {
_s[i] = (unsigned char)c;
}
DANGER_OVER();
return 0;
}
CHECK_4(errno_t, 0, memset_s, void *, rsize_t, int, rsize_t)
/***
The fn(memset) function fills the first arg(n) bytes of memory at arg(s) with
the value arg(c) (converted to an type(unsigned char)).
***/
/* UNSPECIFIED: - */
/* UNDEFINED: - */
/* IMPLEMENTATION: - */
/* LOCALE: - */
/* RETURN: the value of arg(s) */
/*
CEXT1(201112)
*/
|