diff options
author | Eric S. Raymond <esr@thyrsus.com> | 2011-10-09 09:00:40 -0400 |
---|---|---|
committer | Eric S. Raymond <esr@thyrsus.com> | 2011-10-09 09:00:40 -0400 |
commit | a6f20e590e9b485822befc3542caa1f21cdff676 (patch) | |
tree | 0a7a6857dda2943dc5189eff368067f1bd3cf915 /gpsdecode.c | |
parent | afe4984bb17a7a72764b84d7b959dc0431d0a130 (diff) | |
download | gpsd-a6f20e590e9b485822befc3542caa1f21cdff676.tar.gz |
const and splint cleanup.
Diffstat (limited to 'gpsdecode.c')
-rw-r--r-- | gpsdecode.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/gpsdecode.c b/gpsdecode.c index 7027cc6c..0c03a113 100644 --- a/gpsdecode.c +++ b/gpsdecode.c @@ -448,10 +448,11 @@ static void encode(FILE *fpin, FILE *fpout) { char inbuf[BUFSIZ]; struct policy_t policy; - struct gps_data_t gpsdata; + struct gps_device_t session; int lineno = 0; memset(&policy, '\0', sizeof(policy)); + memset(&session, '\0', sizeof(session)); policy.json = true; while (fgets(inbuf, (int)sizeof(inbuf), fpin) != NULL) { @@ -460,15 +461,15 @@ static void encode(FILE *fpin, FILE *fpout) ++lineno; if (inbuf[0] == '#') continue; - status = libgps_json_unpack(inbuf, &gpsdata, NULL); + status = libgps_json_unpack(inbuf, &session.gpsdata, NULL); if (status != 0) { (void)fprintf(stderr, "gpsdecode: dying with status %d (%s) on line %d\n", status, json_error_string(status), lineno); exit(1); } - json_data_report(gpsdata.set, - &gpsdata, &policy, + json_data_report(session.gpsdata.set, + &session, &policy, inbuf, sizeof(inbuf)); (void)fputs(inbuf, fpout); } |