summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTrent Lloyd <lathiat@bur.st>2006-12-16 15:00:11 +0000
committerTrent Lloyd <lathiat@bur.st>2006-12-16 15:00:11 +0000
commit451be30b300b390b46738af3fd24fc942ba3158f (patch)
tree587d925fd5cce26c70d6ff9c425cb27792efeae8
parent83b432c2369d7ef4142811bea0109b6588b6f313 (diff)
* avahi-core/dns.c: Use a '#define AVAHI_DNS_LABELS_MAX 127' instead of the hard-coded value
git-svn-id: file:///home/lennart/svn/public/avahi/trunk@1341 941a03a8-eaeb-0310-b9a0-b1bbd8fe43fe
-rw-r--r--avahi-core/dns.c2
-rw-r--r--avahi-core/dns.h1
2 files changed, 2 insertions, 1 deletions
diff --git a/avahi-core/dns.c b/avahi-core/dns.c
index fec55e4..a3ec0e6 100644
--- a/avahi-core/dns.c
+++ b/avahi-core/dns.c
@@ -335,7 +335,7 @@ static int consume_labels(AvahiDnsPacket *p, unsigned idx, char *ret_name, size_
int i;
assert(p && ret_name && l);
- for (i = 0; i < 127; i++) {
+ for (i = 0; i < AVAHI_DNS_LABELS_MAX; i++) {
uint8_t n;
if (idx+1 > p->size)
diff --git a/avahi-core/dns.h b/avahi-core/dns.h
index 4696e00..d1c06a5 100644
--- a/avahi-core/dns.h
+++ b/avahi-core/dns.h
@@ -28,6 +28,7 @@
#define AVAHI_DNS_PACKET_SIZE_MAX 9000
#define AVAHI_DNS_PACKET_HEADER_SIZE 12
#define AVAHI_DNS_PACKET_EXTRA_SIZE 48
+#define AVAHI_DNS_LABELS_MAX 127
typedef struct AvahiDnsPacket {
size_t size, rindex, max_size;