From 353a26d3e7ebff1a913c227d8768ae042e676eb3 Mon Sep 17 00:00:00 2001 From: Christian Gagneraud Date: Fri, 1 Jun 2012 16:57:22 +0100 Subject: gpsdecode: honor scale flag Currently gpsdecode doesn't care about the -u (unscaled) flag. Fix that. This patch will allow aivdm-regress to run tests in scaled mode. scons check passed. --- gpsdecode.c | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'gpsdecode.c') diff --git a/gpsdecode.c b/gpsdecode.c index 3ade9b8c..51a9c2eb 100644 --- a/gpsdecode.c +++ b/gpsdecode.c @@ -511,6 +511,7 @@ static void decode(FILE *fpin, FILE*fpout) //(void)strlcpy(session.gpsdata.dev.path, "stdin", sizeof(session.gpsdata.dev.path)); memset(&policy, '\0', sizeof(policy)); policy.json = json; + policy.scaled = scaled; gps_context_init(&context); gpsd_time_init(&context, time(NULL)); @@ -576,6 +577,9 @@ static void encode(FILE *fpin, FILE *fpout) "stdin", sizeof(session.gpsdata.dev.path)); policy.json = true; + /* Parsing is always made in unscaled mode, + * this policy applies to the dumping */ + policy.scaled = scaled; while (fgets(inbuf, (int)sizeof(inbuf), fpin) != NULL) { int status; -- cgit v1.2.1