(player_init): Fix initialization of sin. Some systems have a member
sin_zero and choke when it's not zeroed. INADDR_ANY wasn't converted to network byte order, but since it's zero, the bug couldn't bite.
This commit is contained in:
parent
e24ade039f
commit
c4c46190bf
1 changed files with 2 additions and 1 deletions
|
@ -79,9 +79,10 @@ player_init(void)
|
||||||
emp_initque(&Players);
|
emp_initque(&Players);
|
||||||
init_player_commands();
|
init_player_commands();
|
||||||
|
|
||||||
|
memset(&sin, 0, sizeof(sin));
|
||||||
sin.sin_family = AF_INET;
|
sin.sin_family = AF_INET;
|
||||||
if (!*listen_addr)
|
if (!*listen_addr)
|
||||||
sin.sin_addr.s_addr = INADDR_ANY;
|
sin.sin_addr.s_addr = htonl(INADDR_ANY);
|
||||||
else if (isdigit(*listen_addr))
|
else if (isdigit(*listen_addr))
|
||||||
sin.sin_addr.s_addr = inet_addr(listen_addr);
|
sin.sin_addr.s_addr = inet_addr(listen_addr);
|
||||||
else {
|
else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue