summaryrefslogtreecommitdiff
path: root/net_dgpsip.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2013-04-30 23:04:53 -0400
committerEric S. Raymond <esr@thyrsus.com>2013-04-30 23:05:37 -0400
commit321c7710c3f3a17d56e9e5eede9aebadbaf16e3e (patch)
treefae8712111ede1cd948e8846a3bbdafeb8dfd45a /net_dgpsip.c
parent5aa7ce8d00de15c832ab90113ef5b08221746e7f (diff)
downloadgpsd-321c7710c3f3a17d56e9e5eede9aebadbaf16e3e.tar.gz
Fix static-checker warnings. All regression tests pass.
cppchecker now finds variables that could have reduced scope; that's most of these.
Diffstat (limited to 'net_dgpsip.c')
-rw-r--r--net_dgpsip.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net_dgpsip.c b/net_dgpsip.c
index acb463e3..f7209534 100644
--- a/net_dgpsip.c
+++ b/net_dgpsip.c
@@ -21,7 +21,6 @@
int dgpsip_open(struct gps_device_t *device, const char *dgpsserver)
/* open a connection to a DGPSIP server */
{
- char hn[256], buf[BUFSIZ];
char *colon, *dgpsport = "rtcm-sc104";
int opts;
@@ -36,6 +35,7 @@ int dgpsip_open(struct gps_device_t *device, const char *dgpsserver)
device->gpsdata.gps_fd =
netlib_connectsock(AF_UNSPEC, dgpsserver, dgpsport, "tcp");
if (device->gpsdata.gps_fd >= 0) {
+ char hn[256], buf[BUFSIZ];
gpsd_report(LOG_PROG, "connection to DGPS server %s established.\n",
dgpsserver);
(void)gethostname(hn, sizeof(hn));