summaryrefslogtreecommitdiff
path: root/minires
diff options
context:
space:
mode:
authorTed Lemon <source@isc.org>2000-04-06 22:59:25 +0000
committerTed Lemon <source@isc.org>2000-04-06 22:59:25 +0000
commita1abfd34d290c1b231cddc45d9d6a6a70265fc5a (patch)
tree7609b846cc5d64b3cae4e0988f63501009a167ae /minires
parent8dfa97ddef8fcc350bf0973cbedfba5da4431d9e (diff)
downloadisc-dhcp-a1abfd34d290c1b231cddc45d9d6a6a70265fc5a.tar.gz
- Have res_nmkupdate store length result through a pointer, so that the
return status isn't being overloaded.
Diffstat (limited to 'minires')
-rw-r--r--minires/res_mkupdate.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/minires/res_mkupdate.c b/minires/res_mkupdate.c
index 10862a51..46412b99 100644
--- a/minires/res_mkupdate.c
+++ b/minires/res_mkupdate.c
@@ -21,7 +21,7 @@
*/
#if !defined(lint) && !defined(SABER)
-static const char rcsid[] = "$Id: res_mkupdate.c,v 1.3 2000/02/02 22:58:09 mellon Exp $";
+static const char rcsid[] = "$Id: res_mkupdate.c,v 1.4 2000/04/06 22:59:25 mellon Exp $";
#endif /* not lint */
#include <sys/types.h>
@@ -85,7 +85,7 @@ static struct protoent *cgetprotobynumber(int);
*/
int
res_nmkupdate(res_state statp,
- ns_updrec *rrecp_in, u_char *buf, unsigned buflen) {
+ ns_updrec *rrecp_in, u_char *buf, unsigned *blp) {
ns_updrec *rrecp_start = rrecp_in;
HEADER *hp;
u_char *cp, *sp1, *sp2, *startp, *endp;
@@ -100,12 +100,13 @@ res_nmkupdate(res_state statp,
u_int32_t n1, rttl;
u_char *dnptrs[20], **dpp, **lastdnptr;
unsigned siglen, keylen, certlen;
+ unsigned buflen = *blp;
/*
* Initialize header fields.
*/
if ((buf == NULL) || (buflen < HFIXEDSZ))
- return (-1);
+ return -1;
memset(buf, 0, HFIXEDSZ);
hp = (HEADER *) buf;
hp->id = htons(++statp->id);
@@ -651,7 +652,8 @@ res_nmkupdate(res_state statp,
hp->ancount = htons(counts[1]);
hp->nscount = htons(counts[2]);
hp->arcount = htons(counts[3]);
- return (cp - buf);
+ *blp = cp - buf;
+ return 0;
}
/*