repo.or.cz
/
coreboot2.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
mb/google/brya: Create rull variant
[coreboot2.git]
/
src
/
lib
/
memmove.c
blob
45528abaa364dd897c106d979f8c37b6d994ea50
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#include <string.h>
4
void
*
memmove
(
void
*
vdest
,
const void
*
vsrc
,
size_t
count
)
5
{
6
const char
*
src
=
vsrc
;
7
char
*
dest
=
vdest
;
8
9
if
(
dest
<=
src
) {
10
while
(
count
--)
11
*
dest
++ = *
src
++;
12
}
else
{
13
src
+=
count
-
1
;
14
dest
+=
count
-
1
;
15
while
(
count
--)
16
*
dest
-- = *
src
--;
17
}
18
return
vdest
;
19
}