mirror of
https://github.com/NLnetLabs/unbound.git
synced 2025-12-26 01:29:58 -05:00
Fix portability of UINT_MAX and incomplete type of enum in header file.
git-svn-id: file:///svn/unbound/trunk@3000 be551aaa-1e26-0410-a405-d3ace91eadb9
This commit is contained in:
parent
5de712175a
commit
a50f200119
3 changed files with 4 additions and 7 deletions
|
|
@ -694,8 +694,7 @@ ldns_rr_descriptor_maximum(const ldns_rr_descriptor *descriptor)
|
|||
{
|
||||
if (descriptor) {
|
||||
if (descriptor->_variable != LDNS_RDF_TYPE_NONE) {
|
||||
/* Should really be SIZE_MAX... bad FreeBSD. */
|
||||
return UINT_MAX;
|
||||
return 65535; /* cannot be more than 64k */
|
||||
} else {
|
||||
return descriptor->_maximum;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -883,7 +883,7 @@ int ldns_wire2str_ttl_scan(uint8_t** d, size_t* dlen, char** s, size_t* slen)
|
|||
}
|
||||
|
||||
int ldns_wire2str_rdf_scan(uint8_t** d, size_t* dlen, char** s, size_t* slen,
|
||||
ldns_rdf_type rdftype, uint8_t* pkt, size_t pktlen)
|
||||
int rdftype, uint8_t* pkt, size_t pktlen)
|
||||
{
|
||||
if(*dlen == 0) return 0;
|
||||
switch(rdftype) {
|
||||
|
|
|
|||
|
|
@ -20,7 +20,6 @@
|
|||
extern "C" {
|
||||
#endif
|
||||
struct ldns_struct_lookup_table;
|
||||
enum ldns_enum_rdf_type;
|
||||
|
||||
/* lookup tables for standard DNS stuff */
|
||||
/** Taken from RFC 2535, section 7. */
|
||||
|
|
@ -461,15 +460,14 @@ int ldns_wire2str_dname_buf(uint8_t* dname, size_t dname_len, char* str,
|
|||
* @param data_len: length of data buffer.
|
||||
* @param str: string buffer.
|
||||
* @param str_len: length of string buffer.
|
||||
* @param rdftype: the type of the rdata field.
|
||||
* @param rdftype: the type of the rdata field, enum ldns_rdf_type.
|
||||
* @param pkt: packet for decompression, if NULL no decompression.
|
||||
* @param pktlen: length of packet buffer.
|
||||
* @return number of characters (except null) needed to print.
|
||||
* Can return -1 on failure.
|
||||
*/
|
||||
int ldns_wire2str_rdf_scan(uint8_t** data, size_t* data_len, char** str,
|
||||
size_t* str_len, enum ldns_enum_rdf_type rdftype, uint8_t* pkt,
|
||||
size_t pktlen);
|
||||
size_t* str_len, int rdftype, uint8_t* pkt, size_t pktlen);
|
||||
|
||||
/**
|
||||
* Scan wireformat int8 field to string, with user buffers.
|
||||
|
|
|
|||
Loading…
Reference in a new issue