diff udp_sync.c @ 32010:120953a1fc50

Use NULL for recvfrom return arguments we don't care about (source address).
author reimar
date Wed, 08 Sep 2010 18:49:57 +0000
parents 31db5ee9280d
children bf0574ca5c57
line wrap: on
line diff
--- a/udp_sync.c	Wed Sep 08 18:45:34 2010 +0000
+++ b/udp_sync.c	Wed Sep 08 18:49:57 2010 +0000
@@ -78,9 +78,7 @@
 // otherwise, returns 0.
 static int get_udp(int blocking, float *master_position)
 {
-    struct sockaddr_in cliaddr;
     char mesg[100];
-    socklen_t len;
 
     int chars_received = -1;
     int n;
@@ -105,10 +103,8 @@
 
     set_blocking(sockfd, blocking);
 
-    len = sizeof(cliaddr);
-
     while (-1 != (n = recvfrom(sockfd, mesg, sizeof(mesg)-1, 0,
-                               (struct sockaddr *)&cliaddr, &len))) {
+                               NULL, NULL))) {
         // flush out any further messages so we don't get behind
         if (chars_received == -1)
             set_blocking(sockfd, 0);