service: fix compilation with GCC 10
[project/mdnsd.git] / service.c
index 66a3382a0389f52c85e06beed3a270e78c3e7163..bd9f985c57873e6946d4b4da8bac0f628c802d5a 100644 (file)
--- a/service.c
+++ b/service.c
@@ -230,9 +230,9 @@ service_load_blob(struct blob_attr *b)
                blobmsg_for_each_attr(txt, _tb[SERVICE_TXT], rem2)
                        txt_len += 1 + strlen(blobmsg_get_string(txt));
 
-       n = strlen(blobmsg_name(b)) + 1;
+       n = strlen(blobmsg_name(b));
        s = calloc_a(sizeof(*s),
-               &d_id, n,
+               &d_id, n + 1,
                &d_instance, _tb[SERVICE_INSTANCE] ? strlen(blobmsg_get_string(_tb[SERVICE_INSTANCE])) + 1 : 0,
                &d_service, strlen(blobmsg_get_string(_tb[SERVICE_SERVICE])) + 1,
                &d_txt, txt_len);