diff options
author | tlatorre <tlatorre@uchicago.edu> | 2019-01-15 02:01:36 -0600 |
---|---|---|
committer | tlatorre <tlatorre@uchicago.edu> | 2019-01-15 02:01:36 -0600 |
commit | 35770ed49f4d22a577f5ab8b27a97ca8bd2207aa (patch) | |
tree | 571aa4003d582e69572bfb49227e2cc0269e6a88 /src/fit.c | |
parent | 9c910abe7a0359018677a874822d8742d0e616b9 (diff) | |
download | sddm-35770ed49f4d22a577f5ab8b27a97ca8bd2207aa.tar.gz sddm-35770ed49f4d22a577f5ab8b27a97ca8bd2207aa.tar.bz2 sddm-35770ed49f4d22a577f5ab8b27a97ca8bd2207aa.zip |
fix a bug with getting the first MCTK bank
Diffstat (limited to 'src/fit.c')
-rw-r--r-- | src/fit.c | 26 |
1 files changed, 19 insertions, 7 deletions
@@ -6071,14 +6071,26 @@ int main(int argc, char **argv) goto err; } - rv = zebra_get_bank(f,&b,mctk.orig); + if (mctk.orig == mctk.up - KMCVX_MCTK) { + /* This is the first MCTK bank. */ + unpack_mctk(mctk.data, &bmctk); + } else { + /* For some reason SNOMAN sometimes links to the second MCTK + * from the MCGN bank. */ + rv = zebra_get_bank(f,&b,mctk.orig); - if (rv) { - fprintf(stderr, "error getting MCTK bank: %s\n", zebra_err); - goto err; - } + if (b.idh != MCTK_RECORD) { + fprintf(stderr, "error following origin link from MCTK bank!\n"); + goto err; + } + + if (rv) { + fprintf(stderr, "error getting MCTK bank: %s\n", zebra_err); + goto err; + } - unpack_mctk(b.data, &bmctk); + unpack_mctk(b.data, &bmctk); + } if (mctk.up == 0) { fprintf(stderr, "MCVX link is zero!\n"); @@ -6199,7 +6211,7 @@ int main(int argc, char **argv) /* 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->first_bank - KMAST_EV) || skip_second_event) break; rv = zebra_get_bank(f,&b,b.orig); |