From fc95a016d13c1510a024888c1b87bbfe1a7f7601 Mon Sep 17 00:00:00 2001 From: lonkaars Date: Sun, 30 Oct 2022 17:31:16 +0100 Subject: squash more todo's --- stm32f091/protocol.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'stm32f091/protocol.c') diff --git a/stm32f091/protocol.c b/stm32f091/protocol.c index f4be08f..405ceb8 100644 --- a/stm32f091/protocol.c +++ b/stm32f091/protocol.c @@ -7,7 +7,7 @@ #include "esp8266.h" void ws_protocol_res_last_records(ws_s_protocol_parsed_req_cmd* parsed_cmd, ws_s_protocol_res* response, bool send) { - static int record_amount = 0; + static unsigned int record_amount = 0; static unsigned int record_offset = 0; const char* response_header = "id,temperature,humidity,atmospheric_pressure\n"; const unsigned int response_line_len = strlen("xxxx,xx,xx,xx\n"); @@ -21,7 +21,7 @@ void ws_protocol_res_last_records(ws_s_protocol_parsed_req_cmd* parsed_cmd, ws_s if (sscanf(parsed_cmd->argv[2], "%x", &record_offset) < 1) response->success = WS_PROTOCOL_CMD_RETURN_ERROR; else { record_amount = WS_MIN(record_amount + record_offset, ws_backlog_get_record_count()); - record_amount = WS_MAX(0, record_amount - record_offset); + record_amount = WS_MAX(0, (int) record_amount - (int) record_offset); response->msg->bytes = strlen(response_header) + response_line_len * record_amount; } } else { -- cgit v1.2.3