diff --git a/test/aaip_0_2.c b/test/aaip_0_2.c index b280172c..da71527a 100644 --- a/test/aaip_0_2.c +++ b/test/aaip_0_2.c @@ -1258,9 +1258,10 @@ int aaip_decode_attrs(struct aaip_state **handle, char aa_name[2], { int ret, was_non_aa= 0; struct aaip_state *aaip; - size_t h_num, *h_lengths, i, new_mem; + size_t h_num, *h_lengths, i, new_mem, pair_consumed= 0; char **h_names, **h_values; + *consumed= 0; if(flag & (1 << 15)) { if(*handle == NULL) return(0); @@ -1327,10 +1328,11 @@ int aaip_decode_attrs(struct aaip_state **handle, char aa_name[2], ret= aaip->list_pending_pair; aaip->list_pending_pair= 0; } else { - ret= aaip_decode_pair(aaip, data, num_data, consumed, + ret= aaip_decode_pair(aaip, data, num_data, &pair_consumed, aaip->name_buf, aaip->name_buf_size, &aaip->name_buf_fill, aaip->value_buf, aaip->value_buf_size, &aaip->value_buf_fill, 1); + *consumed+= pair_consumed; } if(ret == -2) { /* insufficient result_size */ if(aaip->first_is_name) @@ -1393,6 +1395,7 @@ int aaip_decode_attrs(struct aaip_state **handle, char aa_name[2], aaip->list_num_attrs++; aaip->name_buf_fill= aaip->value_buf_fill= 0; + ret= aaip->list_pending_pair; aaip->list_pending_pair= 0; if(ret == 2)