From e17619d6204aa72069968f4763ba5d2238bb645e Mon Sep 17 00:00:00 2001 From: zhaohe Date: Sat, 22 Mar 2025 14:44:59 +0800 Subject: [PATCH] update --- protocol/packet.hpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocol/packet.hpp b/protocol/packet.hpp index 481ba23..bfe4a09 100644 --- a/protocol/packet.hpp +++ b/protocol/packet.hpp @@ -40,8 +40,8 @@ typedef enum { } zcan_cmd_packet_type_t; static inline bool zcr_cmd_checkpacket(const zcr_cmd_header_t* header, int len) { - if (len < sizeof(zcr_cmd_header_t)) return false; - if ((header->datalen + sizeof(zcr_cmd_header_t) + 1) != len) return false; + if (len < (int)sizeof(zcr_cmd_header_t)) return false; + if ((int)(header->datalen + sizeof(zcr_cmd_header_t) + 1) != len) return false; uint8_t checksum = 0; for (int i = 0; i < len - 1; i++) checksum += ((uint8_t*)header)[i];