aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2019-01-15 02:01:36 -0600
committertlatorre <tlatorre@uchicago.edu>2019-01-15 02:01:36 -0600
commit35770ed49f4d22a577f5ab8b27a97ca8bd2207aa (patch)
tree571aa4003d582e69572bfb49227e2cc0269e6a88 /src
parent9c910abe7a0359018677a874822d8742d0e616b9 (diff)
downloadsddm-35770ed49f4d22a577f5ab8b27a97ca8bd2207aa.tar.gz
sddm-35770ed49f4d22a577f5ab8b27a97ca8bd2207aa.tar.bz2
sddm-35770ed49f4d22a577f5ab8b27a97ca8bd2207aa.zip
fix a bug with getting the first MCTK bank
Diffstat (limited to 'src')
-rw-r--r--src/fit.c26
1 files changed, 19 insertions, 7 deletions
diff --git a/src/fit.c b/src/fit.c
index 64a2a5a..26a5bdf 100644
--- a/src/fit.c
+++ b/src/fit.c
@@ -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);