diff options
author | Keith Packard <keithp@keithp.com> | 2009-11-22 00:52:58 -0800 |
---|---|---|
committer | Keith Packard <keithp@keithp.com> | 2009-11-22 00:52:58 -0800 |
commit | 06cebd1026dc1bd6ee51526fa2d02905df3b3b37 (patch) | |
tree | 4ee2bcc309d02884121e2a8f89f19f5b6ab27baf | |
parent | a9ada1b538af3308e1b22bd024d9204521184173 (diff) |
ao-postflight: don't try to use missing gps sat data
Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r-- | ao-tools/ao-postflight/ao-postflight.c | 24 |
1 files changed, 13 insertions, 11 deletions
diff --git a/ao-tools/ao-postflight/ao-postflight.c b/ao-tools/ao-postflight/ao-postflight.c index 51bcd6e3..48752d07 100644 --- a/ao-tools/ao-postflight/ao-postflight.c +++ b/ao-tools/ao-postflight/ao-postflight.c @@ -407,20 +407,22 @@ analyse_flight(struct cc_flightraw *f, FILE *summary_file, FILE *detail_file, } nsat = 0; - for (k = 0; k < f->gps.sats[j].nsat; k++) { - if (f->gps.sats[j].sat[k].svid != 0) - nsat++; - } - if (gps_file) { - fprintf(gps_file, " %4d", nsat); + if (f->gps.sats) { for (k = 0; k < f->gps.sats[j].nsat; k++) { - if (f->gps.sats[j].sat[k].svid != 0) { - fprintf (gps_file, " %3d(%4.1f)", - f->gps.sats[j].sat[k].svid, - (double) f->gps.sats[j].sat[k].c_n); + if (f->gps.sats[j].sat[k].svid != 0) + nsat++; + } + if (gps_file) { + fprintf(gps_file, " %4d", nsat); + for (k = 0; k < f->gps.sats[j].nsat; k++) { + if (f->gps.sats[j].sat[k].svid != 0) { + fprintf (gps_file, " %3d(%4.1f)", + f->gps.sats[j].sat[k].svid, + (double) f->gps.sats[j].sat[k].c_n); + } } + fprintf(gps_file, "\n"); } - fprintf(gps_file, "\n"); } } if (kml_file) |