projects
/
oweals
/
musl.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
add fast path for normal mutexes back to pthread_mutex_lock
[oweals/musl.git]
/
src
/
string
/
memmove.c
1
#include <string.h>
2
3
void *memmove(void *dest, const void *src, size_t n)
4
{
5
char *d = dest;
6
const char *s = src;
7
if (d==s) return d;
8
if ((size_t)(d-s) < n) {
9
while (n--) d[n] = s[n];
10
return dest;
11
}
12
/* Assumes memcpy is overlap-safe when dest < src */
13
return memcpy(d, s, n);
14
}