From 1e32b83c77c31342e35ac443c80e7ed9da52dc2f Mon Sep 17 00:00:00 2001 From: mauzey1 Date: Wed, 14 Aug 2024 08:22:53 -0700 Subject: [PATCH] Separate check of singleton id from check that accesses the axis array --- Test/test_singletons.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Test/test_singletons.c b/Test/test_singletons.c index dbb164ba..e90e670e 100644 --- a/Test/test_singletons.c +++ b/Test/test_singletons.c @@ -45,8 +45,10 @@ int test_bs550aer(const int *axes_ids, int num_axes, int zfactor_id, double base // Find singleton dimension for bs550aer for(i = 0; i < cmor_vars[var_id].ndims; ++i){ singleton_id = cmor_vars[var_id].singleton_ids[i]; - if(singleton_id != -1 && strcmp(cmor_axes[singleton_id].id, "wavelength") == 0) - wavelength_found++; + if(singleton_id != -1) { + if(strcmp(cmor_axes[singleton_id].id, "wavelength") == 0) + wavelength_found++; + } } if(wavelength_found != 1) fail("error in singleton dimension");