bufr_subset_find_values() fails when TLC keys are used

Bug #891754 reported by cpb
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
libECBUFR
Fix Committed
Undecided
cpb

Bug Description

Testing with the following template:

  201013 201023 5012 101003 12001

Shows that if I do a find using a TLC code, ala:

         k = 0;
         bufr_set_key_location( &(codes[k++]), 5002, 64 );
         bufr_set_key_int32( &(codes[k++]), 12001, NULL, 0 );
         n = bufr_subset_find_values( dss, codes, k, 0 );

I get the wrong instance of 12001. The bug appears to be that in bufr_subset_find_values(), a TLC match still increments to the NEXT descriptor in the list, and because that descriptor is replicated, I get it instead of the one which had the matching TLC value.

I'll commit a test case...

Revision history for this message
cpb (chris-beauregard) wrote :

Ah... another bug is that:

         k = 0;
         ivalues[0] = 291;
         bufr_set_key_int32( &(codes[k++]), 12001, ivalues, 1 );

         n = bufr_subset_find_values( dss, codes, k, 0 );

Gives me the *first* 12001 descriptor in the sequence, because when we match descriptors but not the value, we don't reset the jj index. Which means we don't set it to the actual match.

cpb (chris-beauregard)
Changed in libecbufr:
status: New → Fix Committed
assignee: nobody → cpb (chris-beauregard)
milestone: none → 0.8.2rc2
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.