diff --git a/subsys/mgmt/hawkbit/hawkbit.c b/subsys/mgmt/hawkbit/hawkbit.c index a4b1a8d45480bf..c2bc16987fc9df 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; @@ -845,7 +844,7 @@ static bool send_request(enum http_method method, enum hawkbit_http_request type 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; @@ -875,7 +874,7 @@ static bool send_request(enum http_method method, enum hawkbit_http_request type 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; @@ -922,7 +921,7 @@ static bool send_request(enum http_method method, enum hawkbit_http_request type 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;