blob: 209a89574d746f5b54de8d4ad7819db76293709b (
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
|
#include <string.h>
#include <stdlib.h>
#include "_safety.h"
/** move memory **/
errno_t memmove_s(void *s1, rsize_t s1max, const void *s2, rsize_t n)
{
SIGNAL_SAFE(0);
ASSERT_NONNULL(s1);
ASSERT_NONNULL(s2);
/* Overlap is explicitly allowed */
if (n > s1max) {
/* do the right thing */
}
memmove(s1, s2, n);
return 0;
}
CHECK_4(errno_t, 0, memmove_s, void *, rsize_t, const void *, rsize_t)
/***
The fn(memmove) function copies arg(n) bytes of memory from the object at
arg(s2) to the object at arg(s1). If arg(s1) and arg(s2) overlap, the memory
is copied so that the arg(n) bytes are safely written to arg(s1).
***/
/* UNSPECIFIED: - */
/* UNDEFINED: - */
/* IMPLEMENTATION: - */
/* LOCALE: - */
/* RETURN: the value of arg(s1) */
/*
CEXT1(201112)
*/
|