From adc518a2063ee78e4217a8aba51b116af1af42f4 Mon Sep 17 00:00:00 2001 From: Dirk Engling Date: Sat, 28 Nov 2026 19:46:59 +0100 Subject: Add helper to pack uint32 in network byte order --- src/ot_fullscrape.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) (limited to 'src/ot_fullscrape.c') diff --git a/src/ot_fullscrape.c b/src/ot_fullscrape.c index 0cd1910..3e3b6cb 100644 --- a/src/ot_fullscrape.c +++ b/src/ot_fullscrape.c @@ -121,9 +121,8 @@ static void fullscrape_write_one( ot_tasktype mode, char **cursor, ot_torrent *t case TASK_FULLSCRAPE_TPB_BINARY: memcpy(r, *hash, sizeof(ot_hash)); r += sizeof(ot_hash); - *(uint32_t *)(r + 0) = htonl((uint32_t)seed_count); - *(uint32_t *)(r + 4) = htonl((uint32_t)(peer_count - seed_count)); - r += 8; + pack_uint32(&r, (uint32_t)seed_count); + pack_uint32(&r, (uint32_t)(peer_count - seed_count)); break; case TASK_FULLSCRAPE_TPB_URLENCODED: r += urlencoded_format(r, *hash, sizeof(ot_hash)); -- cgit v1.3