summaryrefslogtreecommitdiff
path: root/sample
diff options
context:
space:
mode:
authoryangyongsheng <iysheng@163.com>2019-12-29 20:52:17 +0800
committeriysheng <iysheng@163.com>2019-12-30 10:09:15 +0800
commit1edb6f6188d5dd2155c6e8ad997eaca11157e95f (patch)
tree60f46094a41596058b5cec4a8965fbc89f7f5dac /sample
parentea12428db66a2c82b57c12afaf5fb5d1a0935f3c (diff)
downloadlibevent-1edb6f6188d5dd2155c6e8ad997eaca11157e95f.tar.gz
Initialize variable to 0 replace use memset function in sample/hello-world.c
Diffstat (limited to 'sample')
-rw-r--r--sample/hello-world.c3
1 files changed, 1 insertions, 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);