projects
/
oweals
/
musl.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
baec93c
)
implement dn_skipname (legacy resolver function)
author
Rich Felker
<dalias@aerifal.cx>
Fri, 5 Apr 2013 02:36:30 +0000
(22:36 -0400)
committer
Rich Felker
<dalias@aerifal.cx>
Fri, 5 Apr 2013 02:36:30 +0000
(22:36 -0400)
src/network/dn_skipname.c
[new file with mode: 0644]
patch
|
blob
diff --git a/src/network/dn_skipname.c
b/src/network/dn_skipname.c
new file mode 100644
(file)
index 0000000..
d54c2e5
--- /dev/null
+++ b/
src/network/dn_skipname.c
@@ -0,0
+1,12
@@
+#include <resolv.h>
+
+int dn_skipname(const unsigned char *s, const unsigned char *end)
+{
+ const unsigned char *p;
+ for (p=s; p<end; p++)
+ if (!*p) return p-s+1;
+ else if (*p>=192)
+ if (p+1<end) return p-s+2;
+ else break;
+ return -1;
+}