diff options
author | jakob <> | 2002-09-07 20:54:04 +0000 |
---|---|---|
committer | jakob <> | 2002-09-07 20:54:04 +0000 |
commit | 3bd21dd4c3a3e3106321a5f6b3641ab9f18a6e3b (patch) | |
tree | da2f633b6f67882cae6be993221af8b0fa009e24 | |
parent | dd40e0369f8b4631697b942f5abc0e0b4dbdf09e (diff) | |
download | openbsd-3bd21dd4c3a3e3106321a5f6b3641ab9f18a6e3b.tar.gz openbsd-3bd21dd4c3a3e3106321a5f6b3641ab9f18a6e3b.tar.bz2 openbsd-3bd21dd4c3a3e3106321a5f6b3641ab9f18a6e3b.zip |
ansi pedantic. ok deraadt@
-rw-r--r-- | src/lib/libc/net/getrrsetbyname.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/lib/libc/net/getrrsetbyname.c b/src/lib/libc/net/getrrsetbyname.c index 87ae8fc229..1ec60486b3 100644 --- a/src/lib/libc/net/getrrsetbyname.c +++ b/src/lib/libc/net/getrrsetbyname.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: getrrsetbyname.c,v 1.4 2001/08/16 18:16:43 ho Exp $ */ | 1 | /* $OpenBSD: getrrsetbyname.c,v 1.5 2002/09/07 20:54:04 jakob Exp $ */ |
2 | 2 | ||
3 | /* | 3 | /* |
4 | * Copyright (c) 2001 Jakob Schlyter. All rights reserved. | 4 | * Copyright (c) 2001 Jakob Schlyter. All rights reserved. |
@@ -78,10 +78,10 @@ struct dns_response { | |||
78 | struct dns_rr *additional; | 78 | struct dns_rr *additional; |
79 | }; | 79 | }; |
80 | 80 | ||
81 | static struct dns_response *parse_dns_response(const char *, int); | 81 | static struct dns_response *parse_dns_response(const u_char *, int); |
82 | static struct dns_query *parse_dns_qsection(const char *, int, const char **, | 82 | static struct dns_query *parse_dns_qsection(const u_char *, int, |
83 | int); | 83 | const u_char **, int); |
84 | static struct dns_rr *parse_dns_rrsection(const char *, int, const char **, | 84 | static struct dns_rr *parse_dns_rrsection(const u_char *, int, const u_char **, |
85 | int); | 85 | int); |
86 | 86 | ||
87 | static void free_dns_query(struct dns_query *); | 87 | static void free_dns_query(struct dns_query *); |
@@ -101,7 +101,7 @@ getrrsetbyname(const char *hostname, unsigned int rdclass, | |||
101 | struct dns_rr *rr; | 101 | struct dns_rr *rr; |
102 | struct rdatainfo *rdata; | 102 | struct rdatainfo *rdata; |
103 | unsigned int length, index_ans, index_sig; | 103 | unsigned int length, index_ans, index_sig; |
104 | char answer[ANSWER_BUFFER_SIZE]; | 104 | u_char answer[ANSWER_BUFFER_SIZE]; |
105 | 105 | ||
106 | /* check for invalid class and type */ | 106 | /* check for invalid class and type */ |
107 | if (rdclass > 0xffff || rdtype > 0xffff) { | 107 | if (rdclass > 0xffff || rdtype > 0xffff) { |
@@ -138,7 +138,8 @@ getrrsetbyname(const char *hostname, unsigned int rdclass, | |||
138 | #endif /* RES_USE_DNSEC */ | 138 | #endif /* RES_USE_DNSEC */ |
139 | 139 | ||
140 | /* make query */ | 140 | /* make query */ |
141 | length = res_query(hostname, rdclass, rdtype, answer, sizeof(answer)); | 141 | length = res_query(hostname, (signed int) rdclass, (signed int) rdtype, |
142 | answer, sizeof(answer)); | ||
142 | if (length < 0) { | 143 | if (length < 0) { |
143 | switch(h_errno) { | 144 | switch(h_errno) { |
144 | case HOST_NOT_FOUND: | 145 | case HOST_NOT_FOUND: |
@@ -280,10 +281,10 @@ freerrset(struct rrsetinfo *rrset) | |||
280 | * DNS response parsing routines | 281 | * DNS response parsing routines |
281 | */ | 282 | */ |
282 | static struct dns_response * | 283 | static struct dns_response * |
283 | parse_dns_response(const char *answer, int size) | 284 | parse_dns_response(const u_char *answer, int size) |
284 | { | 285 | { |
285 | struct dns_response *resp; | 286 | struct dns_response *resp; |
286 | const char *cp; | 287 | const u_char *cp; |
287 | 288 | ||
288 | /* allocate memory for the response */ | 289 | /* allocate memory for the response */ |
289 | resp = calloc(1, sizeof(*resp)); | 290 | resp = calloc(1, sizeof(*resp)); |
@@ -345,7 +346,7 @@ parse_dns_response(const char *answer, int size) | |||
345 | } | 346 | } |
346 | 347 | ||
347 | static struct dns_query * | 348 | static struct dns_query * |
348 | parse_dns_qsection(const char *answer, int size, const char **cp, int count) | 349 | parse_dns_qsection(const u_char *answer, int size, const u_char **cp, int count) |
349 | { | 350 | { |
350 | struct dns_query *head, *curr, *prev; | 351 | struct dns_query *head, *curr, *prev; |
351 | int i, length; | 352 | int i, length; |
@@ -391,7 +392,7 @@ parse_dns_qsection(const char *answer, int size, const char **cp, int count) | |||
391 | } | 392 | } |
392 | 393 | ||
393 | static struct dns_rr * | 394 | static struct dns_rr * |
394 | parse_dns_rrsection(const char *answer, int size, const char **cp, int count) | 395 | parse_dns_rrsection(const u_char *answer, int size, const u_char **cp, int count) |
395 | { | 396 | { |
396 | struct dns_rr *head, *curr, *prev; | 397 | struct dns_rr *head, *curr, *prev; |
397 | int i, length; | 398 | int i, length; |