mirror of
https://github.com/libevent/libevent.git
synced 2025-01-31 09:12:55 +08:00
Initialize variable to 0 replace use memset function in sample/hello-world.c
This commit is contained in:
parent
ea12428db6
commit
1edb6f6188
@ -42,7 +42,7 @@ main(int argc, char **argv)
|
|||||||
struct evconnlistener *listener;
|
struct evconnlistener *listener;
|
||||||
struct event *signal_event;
|
struct event *signal_event;
|
||||||
|
|
||||||
struct sockaddr_in sin;
|
struct sockaddr_in sin = {0};
|
||||||
#ifdef _WIN32
|
#ifdef _WIN32
|
||||||
WSADATA wsa_data;
|
WSADATA wsa_data;
|
||||||
WSAStartup(0x0201, &wsa_data);
|
WSAStartup(0x0201, &wsa_data);
|
||||||
@ -54,7 +54,6 @@ main(int argc, char **argv)
|
|||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(&sin, 0, sizeof(sin));
|
|
||||||
sin.sin_family = AF_INET;
|
sin.sin_family = AF_INET;
|
||||||
sin.sin_port = htons(PORT);
|
sin.sin_port = htons(PORT);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user