From e2695bd13a933a87779ae0c71447ee81486daefa Mon Sep 17 00:00:00 2001 From: Robert Norris Date: Mon, 20 Feb 2017 01:44:44 +0000 Subject: Explicit marking of ignoring fprintf() result Ensure consistent marking of '(void)' for most normal usage of fprintf() TESTED: 'scons build-all check' passes Signed-off-by: Fred Wright --- gps2udp.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'gps2udp.c') diff --git a/gps2udp.c b/gps2udp.c index c02d8929..eb01eb90 100644 --- a/gps2udp.c +++ b/gps2udp.c @@ -89,7 +89,7 @@ static int send_udp (char *nmeastring, size_t ind) /* compute message size and add 0x0a 0x0d */ for (ind=0; nmeastring [ind] != '\0'; ind ++) { if (ind >= sizeof(message) - 3) { - fprintf(stderr, "gps2udp: too big [%s] \n", nmeastring); + (void)fprintf(stderr, "gps2udp: too big [%s] \n", nmeastring); return -1; } message[ind] = nmeastring[ind]; @@ -157,14 +157,14 @@ static int open_udp(char **hostport) sock[channel]= socket(AF_INET, SOCK_DGRAM, 0); if (sock[channel] < 0) { - fprintf(stderr, "gps2udp: error creating UDP socket\n"); + (void)fprintf(stderr, "gps2udp: error creating UDP socket\n"); return (-1); } remote[channel].sin_family = (sa_family_t)AF_INET; hp = gethostbyname(hostname); if (hp==NULL) { - fprintf(stderr, "gps2udp: syntax is [-u hostname:port] [%s] is not a valid hostname\n",hostname); + (void)fprintf(stderr, "gps2udp: syntax is [-u hostname:port] [%s] is not a valid hostname\n",hostname); return (-1); } @@ -476,7 +476,7 @@ int main(int argc, char **argv) (void)fprintf(stdout," MMSI=%9u", mmsi); } - fprintf(stdout,"\n"); + (void)fprintf(stdout,"\n"); } // send to all UDP destinations @@ -496,7 +496,7 @@ int main(int argc, char **argv) } // end for (;;) // This is an infinite loop, should never be here - fprintf (stderr, "gpsd2udp ERROR abnormal exit\n"); + (void)fprintf (stderr, "gpsd2udp ERROR abnormal exit\n"); exit (-1); } -- cgit v1.2.1