aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortlatorre <tlatorre@uchicago.edu>2019-06-14 17:16:37 -0500
committertlatorre <tlatorre@uchicago.edu>2019-06-14 17:16:37 -0500
commit6d6dd6de8a4e17b641e8a73fae612b37c8e8602a (patch)
treee6aebcab303ec802b3415932fba720b5b21184e6
parentdadf6abbb080efba06c991bcaa94324dd6f5d2a0 (diff)
downloadsddm-6d6dd6de8a4e17b641e8a73fae612b37c8e8602a.tar.gz
sddm-6d6dd6de8a4e17b641e8a73fae612b37c8e8602a.tar.bz2
sddm-6d6dd6de8a4e17b641e8a73fae612b37c8e8602a.zip
fix empty list item at top of YAML file
The first logical record in the SNOCR files don't have an EV bank which was causing the output file to have an emtpy list element. This commit fixes the issue by checking for an empty EV bank before printing the list delimiter.
-rw-r--r--src/fit.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/fit.c b/src/fit.c
index 29b5957..adaaaef 100644
--- a/src/fit.c
+++ b/src/fit.c
@@ -6030,6 +6030,11 @@ int main(int argc, char **argv)
goto err;
}
+ if (bmast.links[KMAST_EV-1] == 0) {
+ /* First logical record in SNOCR files don't have an EV bank. */
+ continue;
+ }
+
if (fout) fprintf(fout, " -\n");
if (bmast.links[KMAST_MC-1] == 0) goto skip_mc;
@@ -6128,11 +6133,6 @@ int main(int argc, char **argv)
skip_mc:
- if (bmast.links[KMAST_EV-1] == 0) {
- /* First logical record in SNOCR files doesn't have an EV bank. */
- continue;
- }
-
rv = zebra_get_bank(f,&b,bmast.links[KMAST_EV-1]);
if (rv) {