common: fix a glitch with IPv4 struct initialization

Pointed out by: andrecbarros
Closes: #803
This commit is contained in:
Koichiro IWAO 2017-07-10 10:40:20 +09:00 committed by metalefty
parent 73a37a5441
commit 8c74fcb80c
1 changed files with 1 additions and 1 deletions

View File

@ -1012,7 +1012,7 @@ bind_loopback(int sck, const char *port)
errno6 = errno;
// else IPv4
g_memset(&sa, 0, sizeof(s));
g_memset(&s, 0, sizeof(s));
s.sin_family = AF_INET;
s.sin_addr.s_addr = htonl(INADDR_LOOPBACK); // IPv4 127.0.0.1
s.sin_port = htons((tui16)atoi(port));