This is a duplicate, please ignore

在 2024/2/6 10:49, Hongbin Ji 写道:
When the blk sequence number is 255 and cblk is 0, the original XOR condition
produces a result of 0,and the judgment condition will be unsuccessful.

Signed-off-by: Hongbin Ji <jhb...@163.com>
---
  common/xyzModem.c | 2 +-
  1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/common/xyzModem.c b/common/xyzModem.c
index fb319f7119..0bc1a87067 100644
--- a/common/xyzModem.c
+++ b/common/xyzModem.c
@@ -373,7 +373,7 @@ xyzModem_get_hdr (void)
      }
    ZM_DEBUG (zm_dump (__LINE__));
    /* Validate the message */
-  if ((xyz.blk ^ xyz.cblk) != (unsigned char) 0xFF)
+  if (~xyz.blk != xyz.cblk)
      {
        ZM_DEBUG (zm_dprintf
                ("Framing error - blk: %x/%x/%x\n", xyz.blk, xyz.cblk,

Reply via email to