summaryrefslogtreecommitdiffhomepage
path: root/host.c
diff options
context:
space:
mode:
Diffstat (limited to 'host.c')
-rw-r--r--host.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/host.c b/host.c
index d0ee595..92fe1b6 100644
--- a/host.c
+++ b/host.c
@@ -66,7 +66,7 @@ enet_host_create (const ENetAddress * address, size_t peerCount, size_t channelL
enet_socket_set_option (host -> socket, ENET_SOCKOPT_RCVBUF, ENET_HOST_RECEIVE_BUFFER_SIZE);
enet_socket_set_option (host -> socket, ENET_SOCKOPT_SNDBUF, ENET_HOST_SEND_BUFFER_SIZE);
- if (address != NULL)
+ if (address != NULL && enet_socket_get_address (host -> socket, & host -> address) < 0)
host -> address = * address;
if (! channelLimit || channelLimit > ENET_PROTOCOL_MAXIMUM_CHANNEL_COUNT)