From 8d71f67a727b52e4893508a378cbfc3307a40979 Mon Sep 17 00:00:00 2001 From: Kostya Date: Fri, 30 Aug 2013 02:58:30 -0400 Subject: [PATCH] Changed handshake code to use union IP_Port. --- toxcore/Lossless_UDP.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/toxcore/Lossless_UDP.c b/toxcore/Lossless_UDP.c index b8279604..9725e449 100644 --- a/toxcore/Lossless_UDP.c +++ b/toxcore/Lossless_UDP.c @@ -62,10 +62,10 @@ static uint32_t handshake_id(Lossless_UDP *ludp, IP_Port source) uint32_t id = 0, i; for (i = 0; i < 6; ++i) { - if (ludp->randtable[i][((uint8_t *)&source)[i]] == 0) - ludp->randtable[i][((uint8_t *)&source)[i]] = random_int(); + if (ludp->randtable[i][source.uint8[i]] == 0) + ludp->randtable[i][source.uint8[i]] = random_int(); - id ^= ludp->randtable[i][((uint8_t *)&source)[i]]; + id ^= ludp->randtable[i][source.uint8[i]]; } /* id can't be zero. */