From e9a264f29dc6105f08aded2464125b012bf65713 Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Fri, 8 Oct 2021 10:41:57 -0500 Subject: [PATCH] fix: minor dead store assignment warning in buildHandshakeMessage() (#1901) --- libtransmission/handshake.cc | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/libtransmission/handshake.cc b/libtransmission/handshake.cc index 7f146600e..77e805da5 100644 --- a/libtransmission/handshake.cc +++ b/libtransmission/handshake.cc @@ -201,9 +201,8 @@ static bool buildHandshakeMessage(tr_handshake* handshake, uint8_t* buf) memcpy(walk, torrent_hash, SHA_DIGEST_LENGTH); walk += SHA_DIGEST_LENGTH; memcpy(walk, peer_id, PEER_ID_LEN); - walk += PEER_ID_LEN; - TR_ASSERT(walk - buf == HANDSHAKE_SIZE); + TR_ASSERT(walk + PEER_ID_LEN - buf == HANDSHAKE_SIZE); } return success;