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
* io.c (rb_open_file): encoding in mode string was ignored if perm is
[ruby-svn.git]
/
missing
/
memcmp.c
blob
5b3ad3817a5dece9e5ea2f1062a5ce86eba8c5e2
1
/* public domain rewrite of memcmp(3) */
2
3
#include <stddef.h>
4
5
int
6
memcmp
(
const void
*
s1
,
const void
*
s2
,
size_t
len
)
7
{
8
register
unsigned char
*
a
= (
unsigned char
*)
s1
;
9
register
unsigned char
*
b
= (
unsigned char
*)
s2
;
10
register
int
tmp
;
11
12
for
(;
len
; --
len
) {
13
if
(
tmp
= *
a
++ - *
b
++)
14
return
tmp
;
15
}
16
return
0
;
17
}