}
/** print and escape one character for a domain dname */
-static int dname_char_print(char** s, size_t* slen, char c)
+static int dname_char_print(char** s, size_t* slen, uint8_t c)
{
if(c == '.' || c == ';' || c == '(' || c == ')' || c == '\\')
return sldns_str_print(s, slen, "\\%c", c);
return sldns_str_print(s, slen, "\\%03u", (unsigned)c);
/* plain printout */
if(*slen) {
- **s = c;
+ **s = (char)c;
(*s)++;
(*slen)--;
}
else if(!in_buf && pos+labellen > pkt+pktlen)
labellen = (uint8_t)(pkt + pktlen - pos);
for(i=0; i<(unsigned)labellen; i++) {
- w += dname_char_print(s, slen, (char)(*pos++));
+ w += dname_char_print(s, slen, *pos++);
}
if(in_buf) {
(*d) += labellen;
}
/** printout escaped TYPE_STR character */
-static int str_char_print(char** s, size_t* sl, char c)
+static int str_char_print(char** s, size_t* sl, uint8_t c)
{
if(isprint((int)c) || c == '\t') {
if(c == '\"' || c == '\\')
return sldns_str_print(s, sl, "\\%c", c);
if(*sl) {
- **s = c;
+ **s = (char)c;
(*s)++;
(*sl)--;
}
(*dl)--;
w += sldns_str_print(s, sl, "\"");
for(i=0; i<len; i++)
- w += str_char_print(s, sl, (char)(*d)[i]);
+ w += str_char_print(s, sl, (*d)[i]);
w += sldns_str_print(s, sl, "\"");
(*d)+=len;
(*dl)-=len;
int w = 0;
w += sldns_str_print(s, sl, "\"");
for(i=0; i<*dl; i++)
- w += str_char_print(s, sl, (char)(*d)[i]);
+ w += str_char_print(s, sl, (*d)[i]);
w += sldns_str_print(s, sl, "\"");
(*d)+=*dl;
(*dl)=0;