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
/
memcmp.c
blob
a9690359b95a318e66ec0e635d8b7e920c76c472
1
/* SPDX-License-Identifier: GPL-2.0-only */
2
3
#include <string.h>
4
5
int
memcmp
(
const void
*
src1
,
const void
*
src2
,
size_t
bytes
)
6
{
7
const unsigned char
*
s1
, *
s2
;
8
int
result
;
9
s1
=
src1
;
10
s2
=
src2
;
11
result
=
0
;
12
while
((
bytes
>
0
) && (
result
==
0
)) {
13
result
= *
s1
- *
s2
;
14
bytes
--;
15
s1
++;
16
s2
++;
17
}
18
return
result
;
19
}