From 81ee38611db4c9849a09e9b352acf7ee5f4c129e Mon Sep 17 00:00:00 2001 From: Olaf Bergmann Date: Fri, 1 Feb 2013 13:58:11 +0100 Subject: [PATCH] applied patch from chrysn to fix bug in .well-known/core generation (missing 2 bytes) --- net.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net.c b/net.c index ddab9dfc..3b76e2e7 100644 --- a/net.c +++ b/net.c @@ -867,11 +867,11 @@ wellknown_response(coap_context_t *context, coap_pdu_t *request) { /* Manually set payload of response to let print_wellknown() write, * into our buffer without copying data. */ - len = resp->max_size - resp->length - 1; resp->data = (unsigned char *)resp->hdr + resp->length; *resp->data = COAP_PAYLOAD_START; resp->data++; - resp->length--; + resp->length++; + len = resp->max_size - resp->length; if (!print_wellknown(context, resp->data, &len, coap_check_option(request, COAP_OPTION_URI_QUERY, &opt_iter))) {