repo.or.cz
/
musl.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
loongarch64: add new syscall numbers
[musl.git]
/
src
/
network
/
dn_skipname.c
blob
eba65bb82ad277a15662084e570c6fd6046b0f1f
1
#include <resolv.h>
2
3
int
dn_skipname
(
const unsigned char
*
s
,
const unsigned char
*
end
)
4
{
5
const unsigned char
*
p
=
s
;
6
while
(
p
<
end
)
7
if
(!*
p
)
return
p
-
s
+
1
;
8
else if
(*
p
>=
192
)
9
if
(
p
+
1
<
end
)
return
p
-
s
+
2
;
10
else break
;
11
else
12
if
(
end
-
p
<*
p
+
1
)
break
;
13
else
p
+= *
p
+
1
;
14
return
-
1
;
15
}