From 451be30b300b390b46738af3fd24fc942ba3158f Mon Sep 17 00:00:00 2001 From: Trent Lloyd Date: Sat, 16 Dec 2006 15:00:11 +0000 Subject: [PATCH] * 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 --- avahi-core/dns.c | 2 +- avahi-core/dns.h | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) 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; -- 2.39.5