Gitiles
Code Review
Sign In
gerrit-public.fairphone.software
/
platform
/
external
/
musl
/
1b23145e8890f4930c9129ed3f28eea9cbb1effc
/
.
/
src
/
string
/
strncmp.c
blob: e228843f0bb394a209b764296e1df52fc8663344 [
file
] [
log
] [
blame
]
#include
<string.h>
int
strncmp
(
const
char
*
_l
,
const
char
*
_r
,
size_t
n
)
{
const
unsigned
char
*
l
=(
void
*)
_l
,
*
r
=(
void
*)
_r
;
if
(!
n
--)
return
0
;
for
(;
*
l
&&
*
r
&&
n
&&
*
l
==
*
r
;
l
++,
r
++,
n
--);
return
*
l
-
*
r
;
}