reuse mdns_buf for cache_answer()
[project/mdnsd.git] / cache.c
diff --git a/cache.c b/cache.c
index 1cbe18f..dbd258d 100644 (file)
--- a/cache.c
+++ b/cache.c
@@ -226,8 +226,7 @@ cache_answer(struct interface *iface, uint8_t *base, int blen, char *name, struc
        char *name_buf;
        void *rdata_ptr, *txt_ptr;
        int host_len = 0;
-
-       static char rdata_buffer[MAX_DATA_LEN + 1];
+       static char *rdata_buffer = (char *) mdns_buf;
 
        if (!(a->class & CLASS_IN))
                return;
@@ -343,7 +342,7 @@ cache_dump_records(struct blob_buf *buf, const char *name)
 {
        struct cache_record *r, *q = avl_find_element(&records, name, r, avl);
        const char *txt;
-       char buffer[MAX_NAME_LEN];
+       char buffer[INET6_ADDRSTRLEN];
 
        if (!q)
                return;