common: fix more glitches in IPv4 initialization

This commit is contained in:
Koichiro IWAO 2017-07-14 21:08:03 +09:00 committed by metalefty
parent 4b87548b71
commit aa0721a90e

View File

@ -753,7 +753,7 @@ connect_loopback(int sck, const char *port)
}
// 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));
@ -944,7 +944,7 @@ g_tcp_bind(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_ANY); // IPv4 0.0.0.0
s.sin_port = htons((tui16)atoi(port));