summaryrefslogtreecommitdiff
path: root/gps2udp.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-11-06 08:06:51 -0500
committerEric S. Raymond <esr@thyrsus.com>2013-11-06 08:07:42 -0500
commitd93ba6e008cb6a7f75adf3d4c08876cf96fe95b0 (patch)
treedad294889820f98f7d7a9e50e0f9baac12796977 /gps2udp.c
parentf597416e78989e83b67608a4fb0542e2b33554d5 (diff)
downloadgpsd-d93ba6e008cb6a7f75adf3d4c08876cf96fe95b0.tar.gz
More cppcheck cleanup. All regression tests pass. PPS is live.
Diffstat (limited to 'gps2udp.c')
-rw-r--r--gps2udp.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/gps2udp.c b/gps2udp.c
index 53ee169f..2d76d12b 100644
--- a/gps2udp.c
+++ b/gps2udp.c
@@ -83,7 +83,6 @@ static int send_udp (char *nmeastring, size_t ind)
char message [255];
char *buffer;
int channel;
- ssize_t status;
/* if string length is unknown make a copy and compute it */
if (ind == 0) {
@@ -109,6 +108,7 @@ static int send_udp (char *nmeastring, size_t ind)
/* send message on udp channel */
/*@-type@*/
for (channel=0; channel < udpchannel; channel ++) {
+ ssize_t status;
status = sendto(sock[channel],
buffer,
ind,
@@ -128,14 +128,14 @@ static int send_udp (char *nmeastring, size_t ind)
static int open_udp(char **hostport)
/* Open and bind udp socket to host */
{
- struct hostent *hp;
- char *hostname = NULL;
- char *portname = NULL;
- int portnum, channel;
-
+ int channel;
for (channel=0; channel <udpchannel; channel ++)
{
- /* parse argument */
+ struct hostent *hp;
+ char *hostname = NULL;
+ char *portname = NULL;
+ int portnum;
+ /* parse argument */
/*@-unrecog@*/
hostname = strsep(&hostport[channel], ":");
portname = strsep(&hostport[channel], ":");