diff options
author | Rich Felker <dalias@aerifal.cx> | 2013-08-14 17:58:20 -0400 |
---|---|---|
committer | Rich Felker <dalias@aerifal.cx> | 2013-08-14 17:58:20 -0400 |
commit | fcc522c92335783293ac19df318415cd97fbf66b (patch) | |
tree | 35de93be8123cb7cd075994087d132e3c8bbb906 /include | |
parent | cccc1844be95549e5b6c91ffc1f2c2ba3d3aab16 (diff) | |
download | musl-fcc522c92335783293ac19df318415cd97fbf66b.tar.gz musl-fcc522c92335783293ac19df318415cd97fbf66b.tar.bz2 musl-fcc522c92335783293ac19df318415cd97fbf66b.tar.xz musl-fcc522c92335783293ac19df318415cd97fbf66b.zip |
de-duplicate dn_expand, fix return value and signature, clean up
the duplicate code in dn_expand and its incorrect return values are
both results of the history of the code: the version in __dns.c was
originally written with no awareness of the legacy resolver API, and
was later copy-and-paste duplicated to provide the legacy API.
this commit is the first of a series that will restructure the
internal dns code to share as much code as possible with the legacy
resolver API functions.
I have also removed the loop detection logic, since the output buffer
length limit naturally prevents loops. in order to avoid long runtime
when encountering a loop if the caller provided a ridiculously long
buffer, the caller-provided length is clamped at the maximum dns name
length.
Diffstat (limited to 'include')
-rw-r--r-- | include/resolv.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/include/resolv.h b/include/resolv.h index cdedd274..259e4bc1 100644 --- a/include/resolv.h +++ b/include/resolv.h @@ -134,7 +134,7 @@ int res_search(const char *, int, int, unsigned char *, int); int res_mkquery(int, const char *, int, int, char *, int, struct rrec *, char *, int); int res_send(const char *, int, char *, int); int dn_comp(unsigned char *, unsigned char *, int, unsigned char **, unsigned char *, unsigned char **); -int dn_expand(unsigned char *, unsigned char *, unsigned char *, unsigned char *, int); +int dn_expand(const unsigned char *, const unsigned char *, const unsigned char *, char *, int); int dn_skipname(const unsigned char *, const unsigned char *); #ifdef __cplusplus |