Initialize variable to 0 replace use memset function in sample/hello-world.c

(cherry picked from commit 1edb6f6188d5dd2155c6e8ad997eaca11157e95f)
This commit is contained in:
yangyongsheng 2019-12-29 20:52:17 +08:00 committed by Azat Khuzhin
parent 2db851a980
commit d9da412658

View File

@ -42,7 +42,7 @@ main(int argc, char **argv)
struct evconnlistener *listener;
struct event *signal_event;
struct sockaddr_in sin;
struct sockaddr_in sin = {0};
#ifdef _WIN32
WSADATA wsa_data;
WSAStartup(0x0201, &wsa_data);
@ -54,7 +54,6 @@ main(int argc, char **argv)
return 1;
}
memset(&sin, 0, sizeof(sin));
sin.sin_family = AF_INET;
sin.sin_port = htons(PORT);