blob: 5a67abe26ac5154846605831f208a3f72b8ed544 (
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
|
#include <wchar.h>
#include <stdlib.h>
#include "_assert.h"
wchar_t * wmemmove(wchar_t * s1, const wchar_t * s2, size_t n)
{
ASSERT_NONNULL(s1);
ASSERT_NONNULL(s2);
if (s1 < s2) {
return wmemcpy(s1, s2, n);
}
/* reverse memcpy() */
while (n > 0) {
s1[n] = s2[n];
n--;
}
/* last byte */
s1[n] = s2[n];
/*
RETURN_ALWAYS(ARGUMENT(s1));
*/
return s1;
}
/*
STDC(199409)
*/
|