summaryrefslogtreecommitdiff
path: root/gpspipe.c
diff options
context:
space:
mode:
authorEric S. Raymond <esr@thyrsus.com>2012-05-16 20:42:26 -0400
committerEric S. Raymond <esr@thyrsus.com>2012-05-16 20:42:26 -0400
commitddc22ff56acef0690abfd22ee640cda4eb143933 (patch)
treebcbccbbab554a3e2915abfad9b5fe91a6604ff08 /gpspipe.c
parent61ab6a6636762115689a190b4a9fe3386008d24c (diff)
downloadgpsd-ddc22ff56acef0690abfd22ee640cda4eb143933.tar.gz
Cleanup motivated by new cppcheck with more tests. All regression tests pass.
Diffstat (limited to 'gpspipe.c')
-rw-r--r--gpspipe.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/gpspipe.c b/gpspipe.c
index c65719dd..69aa7484 100644
--- a/gpspipe.c
+++ b/gpspipe.c
@@ -280,8 +280,6 @@ int main(int argc, char **argv)
vflag = 0;
for (;;) {
- int i = 0;
- int j = 0;
int r = 0;
struct timeval tv;
@@ -305,6 +303,8 @@ int main(int argc, char **argv)
errno = 0;
r = (int)read(gpsdata.gps_fd, buf, sizeof(buf));
if (r > 0) {
+ int i = 0;
+ int j = 0;
for (i = 0; i < r; i++) {
char c = buf[i];
if (j < (int)(sizeof(serbuf) - 1)) {