diff options
Diffstat (limited to 'src/fit.c')
-rw-r--r-- | src/fit.c | 21 |
1 files changed, 7 insertions, 14 deletions
@@ -6131,25 +6131,18 @@ int main(int argc, char **argv) break; } - rv = zebra_get_bank(f, &bmast, f->first_bank); + if (f->mast_bank == -1) { + fprintf(stderr, "no MAST bank in logical record! Skipping...\n"); + continue; + } + + rv = zebra_get_bank(f, &bmast, f->mast_bank); if (rv) { fprintf(stderr, "error getting MAST bank: %s\n", zebra_err); goto err; } - if (!strncmp(bmast.name,"MAST",4)) { - ; - } else if (!strncmp(bmast.name,"ZDAB",4)) { - /* Not sure why, but occasionally some of the zdabs output by - * SNOMAN have logical records which start with a ZDAB record - * instead of a MAST record. */ - continue; - } else { - fprintf(stderr, "logical record starts with unknown bank '%s'\n", bmast.name); - goto err; - } - if (bmast.links[KMAST_EV-1] == 0) { /* First logical record in SNOCR files don't have an EV bank. */ continue; @@ -6378,7 +6371,7 @@ skip_event: /* Note the origin link for the first EV bank points back to the * structural link location in the MAST bank. These links are super * confusing! */ - if ((b.orig == f->first_bank - KMAST_EV) || skip_second_event) break; + if ((b.orig == f->mast_bank - KMAST_EV) || skip_second_event) break; rv = zebra_get_bank(f,&b,b.orig); |