From 1edb6f6188d5dd2155c6e8ad997eaca11157e95f Mon Sep 17 00:00:00 2001 From: yangyongsheng Date: Sun, 29 Dec 2019 20:52:17 +0800 Subject: [PATCH] Initialize variable to 0 replace use memset function in sample/hello-world.c --- sample/hello-world.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/sample/hello-world.c b/sample/hello-world.c index 2023cd6c..a13e06af 100644 --- a/sample/hello-world.c +++ b/sample/hello-world.c @@ -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); -- 2.40.0