Skip to content

Commit

Permalink
Explicitly wrap the host pt into the random seed
Browse files Browse the repository at this point in the history
  • Loading branch information
kcgen committed Jul 28, 2022
1 parent ac16add commit 608b68e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion include/enet.h
Original file line number Diff line number Diff line change
Expand Up @@ -4438,7 +4438,7 @@ extern "C" {
channelLimit = ENET_PROTOCOL_MAXIMUM_CHANNEL_COUNT;
}

host->randomSeed = (enet_uint32) (size_t) host;
host->randomSeed = (enet_uint32) ((uintptr_t) host % UINT32_MAX);
host->randomSeed += enet_host_random_seed();
host->randomSeed = (host->randomSeed << 16) | (host->randomSeed >> 16);
host->channelLimit = channelLimit;
Expand Down

0 comments on commit 608b68e

Please sign in to comment.