]> git.ipfire.org Git - thirdparty/unbound.git/commitdiff
Fix portability of UINT_MAX and incomplete type of enum in header file.
authorWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 31 Oct 2013 15:28:13 +0000 (15:28 +0000)
committerWouter Wijngaards <wouter@nlnetlabs.nl>
Thu, 31 Oct 2013 15:28:13 +0000 (15:28 +0000)
git-svn-id: file:///svn/unbound/trunk@3000 be551aaa-1e26-0410-a405-d3ace91eadb9

ldns/rrdef.c
ldns/wire2str.c
ldns/wire2str.h

index 0d4d14038fa6d1a5b12f74576ce5027dc3b7188c..4043dd2fd1523724181c149418e7cff915bda694 100644 (file)
@@ -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;
                }
index 8bd74f11078b8b22cfaa62ee90526a60744076ed..d68335247ff8dcf08b7d5ac45c186560b161011a 100644 (file)
@@ -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) {
index a29ace7a36ce3d501ffffce1a2aec0681083a434..339a30c3fd0c53d5e8be1690076564c6b04fb690 100644 (file)
@@ -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.