# HG changeset patch # User reimar # Date 1283968747 0 # Node ID 2b209fa9c48d489eba08851ed0295c574883a2a5 # Parent b429f2102412db19c83d0091c77c2523f115676f Do not check a condition that can never be false and move its comment to the real check. diff -r b429f2102412 -r 2b209fa9c48d udp_sync.c --- a/udp_sync.c Wed Sep 08 17:55:35 2010 +0000 +++ b/udp_sync.c Wed Sep 08 17:59:07 2010 +0000 @@ -106,6 +106,7 @@ chars_received = recvfrom(sockfd, mesg, sizeof(mesg)-1, 0, (struct sockaddr *)&cliaddr, &len); + // UDP wait error, probably a timeout. Safe to ignore. if (chars_received == -1) return 0; @@ -125,7 +126,6 @@ return 1; } - if (chars_received > -1) { mesg[chars_received] = 0; if (strcmp(mesg, "bye") == 0) { @@ -134,9 +134,6 @@ sscanf(mesg, "%f", master_position); return 0; } - } else { - // UDP wait error, probably a timeout. Safe to ignore. - } return 0; }