changeset 31990:4111548d28f9

Use initializer instead of memset, the memset in addition never worked due to swapped arguments.
author reimar
date Wed, 08 Sep 2010 17:50:05 +0000
parents e648473842bd
children 52a0d770adee
files udp_sync.c
diffstat 1 files changed, 1 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/udp_sync.c	Wed Sep 08 17:48:42 2010 +0000
+++ b/udp_sync.c	Wed Sep 08 17:50:05 2010 +0000
@@ -76,13 +76,12 @@
     static int sockfd;
     if (!done_init_yet) {
         struct timeval tv;
-        struct sockaddr_in servaddr;
+        struct sockaddr_in servaddr = { 0 };
 
         done_init_yet = 1;
 
         sockfd = socket(AF_INET, SOCK_DGRAM, 0);
 
-        memset(&servaddr, sizeof(servaddr), 0);
         servaddr.sin_family      = AF_INET;
         servaddr.sin_addr.s_addr = htonl(INADDR_ANY);
         servaddr.sin_port        = htons(udp_port);