mirror of
https://github.com/Tiiffi/mcrcon.git
synced 2025-12-16 02:02:53 -05:00
Add byteswap to net_send_packet() function
Fixes broken packet size calculation on big endian machines.
This commit is contained in:
3
mcrcon.c
3
mcrcon.c
@@ -401,7 +401,8 @@ int net_connect(const char *host, const char *port)
|
||||
bool net_send_packet(int sd, rc_packet *packet)
|
||||
{
|
||||
size_t sent = 0;
|
||||
size_t size = (size_t) packet->size + (ssize_t) sizeof(int32_t);
|
||||
size_t packet_size = bswap32(packet->size);
|
||||
size_t size = packet_size + (ssize_t) sizeof(int32_t);
|
||||
size_t left = size;
|
||||
|
||||
char *p = (char *) packet;
|
||||
|
||||
Reference in New Issue
Block a user