On Tue, Feb 06, 2024 at 10:49:25AM +0800, Hongbin Ji wrote:

> 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,

As Dan noted before, this is very old code. Is there a problem you're
encountering in the real world? What has brought you to see a problem
and make a change here? Thanks.

-- 
Tom

Attachment: signature.asc
Description: PGP signature

Reply via email to