diff options
author | Rich Felker <dalias@aerifal.cx> | 2013-04-04 22:36:30 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2013-04-04 22:36:30 -0400 |
commit | b6f99412019219eda032823030846bc4c90b7cbc (patch) | |
tree | 8d0192ebbe37b38718bb6c694c5845dbb88538b3 | |
parent | baec93cb5819058e36d44a427db708260f320bd1 (diff) | |
download | musl-b6f99412019219eda032823030846bc4c90b7cbc.tar.gz musl-b6f99412019219eda032823030846bc4c90b7cbc.tar.bz2 musl-b6f99412019219eda032823030846bc4c90b7cbc.tar.xz musl-b6f99412019219eda032823030846bc4c90b7cbc.zip |
implement dn_skipname (legacy resolver function)
-rw-r--r-- | src/network/dn_skipname.c | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/src/network/dn_skipname.c b/src/network/dn_skipname.c new file mode 100644 index 00000000..d54c2e5d --- /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; +} |