summaryrefslogtreecommitdiff
path: root/sldns/wire2str.c
diff options
context:
space:
mode:
Diffstat (limited to 'sldns/wire2str.c')
-rw-r--r--sldns/wire2str.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/sldns/wire2str.c b/sldns/wire2str.c
index 639f56fae72e..0efa65f75664 100644
--- a/sldns/wire2str.c
+++ b/sldns/wire2str.c
@@ -667,7 +667,7 @@ int sldns_wire2str_rdata_scan(uint8_t** d, size_t* dlen, char** s,
uint8_t* origd = *d;
char* origs = *s;
size_t origdlen = *dlen, origslen = *slen;
- uint16_t r_cnt, r_max;
+ size_t r_cnt, r_max;
sldns_rdf_type rdftype;
int w = 0, n;
@@ -788,8 +788,9 @@ int sldns_wire2str_dname_scan(uint8_t** d, size_t* dlen, char** s, size_t* slen,
}
/* spool label characters, end with '.' */
- if(in_buf && *dlen < labellen) labellen = *dlen;
- else if(!in_buf && pos+labellen > pkt+pktlen)
+ if(in_buf && *dlen < (size_t)labellen)
+ labellen = (uint8_t)*dlen;
+ else if(!in_buf && pos+(size_t)labellen > pkt+pktlen)
labellen = (uint8_t)(pkt + pktlen - pos);
for(i=0; i<(unsigned)labellen; i++) {
w += dname_char_print(s, slen, *pos++);
@@ -1960,10 +1961,10 @@ int sldns_wire2str_edns_scan(uint8_t** data, size_t* data_len, char** str,
w += sldns_str_print(str, str_len, " ; udp: %u", (unsigned)udpsize);
if(rdatalen) {
- if(*data_len < rdatalen) {
+ if((size_t)*data_len < rdatalen) {
w += sldns_str_print(str, str_len,
" ; Error EDNS rdata too short; ");
- rdatalen = *data_len;
+ rdatalen = (uint16_t)*data_len;
}
w += print_edns_opts(str, str_len, *data, rdatalen);
(*data) += rdatalen;