repo.or.cz
/
ruby-svn.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
* include/ruby/io.h (rb_io_t): new fields: writeconv,
[ruby-svn.git]
/
missing
/
memmove.c
blob
19c5f18847ed8d4b3f436223a45ba2e2f33f0411
1
/* public domain rewrite of memcmp(3) */
2
3
#include <stddef.h>
4
5
void
*
6
memmove
(
void
*
d
,
const void
*
s
,
size_t
n
)
7
{
8
char
*
dst
= (
char
*)
d
;
9
const char
*
src
= (
const char
*)
s
;
10
11
if
(
src
<
dst
) {
12
src
+=
n
;
13
dst
+=
n
;
14
for
(;
n
; --
n
)
15
*--
dst
= *--
src
;
16
}
17
else if
(
dst
<
src
)
18
for
(;
n
; --
n
)
19
*
dst
++ = *
src
++;
20
return
d
;
21
}