diff --git a/subsys/mgmt/hawkbit/hawkbit.c b/subsys/mgmt/hawkbit/hawkbit.c index 867dfeb3b728f0..ec5e8182203485 100644 --- a/subsys/mgmt/hawkbit/hawkbit.c +++ b/subsys/mgmt/hawkbit/hawkbit.c @@ -81,7 +81,6 @@ static struct hawkbit_context { uint8_t *response_data; int32_t json_action_id; size_t url_buffer_size; - size_t status_buffer_size; struct hawkbit_download dl; struct http_request http_req; struct flash_img_context flash_ctx; @@ -903,7 +902,7 @@ static bool send_request(enum http_method method, ret = json_obj_encode_buf(json_cfg_descr, ARRAY_SIZE(json_cfg_descr), &cfg, hb_context.status_buffer, - hb_context.status_buffer_size - 1); + sizeof(hb_context.status_buffer)); if (ret) { LOG_ERR("Can't encode the JSON script (HAWKBIT_CONFIG_DEVICE): %d", ret); return false; @@ -938,7 +937,7 @@ static bool send_request(enum http_method method, ret = json_obj_encode_buf(json_close_descr, ARRAY_SIZE(json_close_descr), &close, hb_context.status_buffer, - hb_context.status_buffer_size - 1); + sizeof(hb_context.status_buffer)); if (ret) { LOG_ERR("Can't encode the JSON script (HAWKBIT_CLOSE): %d", ret); return false; @@ -989,7 +988,7 @@ static bool send_request(enum http_method method, ret = json_obj_encode_buf(json_dep_fbk_descr, ARRAY_SIZE(json_dep_fbk_descr), &feedback, hb_context.status_buffer, - hb_context.status_buffer_size - 1); + sizeof(hb_context.status_buffer)); if (ret) { LOG_ERR("Can't encode the JSON script (HAWKBIT_REPORT): %d", ret); return ret;