Fix subquery_count loop variable updating
svn path=/trunk/; revision=42624
static gint
spotlight_dissect_query_loop(tvbuff_t *tvb, proto_tree *tree, gint offset, guint64 cpx_query_type, gint count, gint toc_offset, guint encoding)
{
static gint
spotlight_dissect_query_loop(tvbuff_t *tvb, proto_tree *tree, gint offset, guint64 cpx_query_type, gint count, gint toc_offset, guint encoding)
{
gint subquery_count;
gint toc_index;
guint64 query_data64;
gint subquery_count;
gint toc_index;
guint64 query_data64;
sub_tree = proto_item_add_subtree(item_query, ett_afp_spotlight_query_line);
offset += 8;
offset = spotlight_dissect_query_loop(tvb, sub_tree, offset, complex_query_type, subquery_count, toc_offset, encoding);
sub_tree = proto_item_add_subtree(item_query, ett_afp_spotlight_query_line);
offset += 8;
offset = spotlight_dissect_query_loop(tvb, sub_tree, offset, complex_query_type, subquery_count, toc_offset, encoding);
break;
case SQ_TYPE_NULL:
subquery_count = (gint)(query_data64 >> 32);
break;
case SQ_TYPE_NULL:
subquery_count = (gint)(query_data64 >> 32);
- proto_tree_add_text(tree, tvb, offset, query_length, "%u %s", subquery_count, plurality(subquery_count, "null", "nulls"));
- count -= subquery_count;
+ for (i = 0; i < subquery_count; i++, count--)
+ proto_tree_add_text(tree, tvb, offset, query_length, "null");
offset += query_length;
break;
case SQ_TYPE_BOOL:
proto_tree_add_text(tree, tvb, offset, query_length, "bool: %s",
(query_data64 >> 32) ? "true" : "false");
offset += query_length;
break;
case SQ_TYPE_BOOL:
proto_tree_add_text(tree, tvb, offset, query_length, "bool: %s",
(query_data64 >> 32) ? "true" : "false");
offset += query_length;
break;
case SQ_TYPE_INT64:
offset += query_length;
break;
case SQ_TYPE_INT64:
offset += query_length;
break;
case SQ_TYPE_CNIDS:
offset += query_length;
break;
case SQ_TYPE_CNIDS:
sub_tree = proto_item_add_subtree(item_query, ett_afp_spotlight_query_line);
spotlight_CNID_array(tvb, sub_tree, offset + 8, encoding);
}
sub_tree = proto_item_add_subtree(item_query, ett_afp_spotlight_query_line);
spotlight_CNID_array(tvb, sub_tree, offset + 8, encoding);
}
offset += query_length;
break;
case SQ_TYPE_DATE:
offset += query_length;
break;
case SQ_TYPE_DATE:
t.secs = query_data64 - SPOTLIGHT_TIME_DELTA;
t.nsecs = 0;
proto_tree_add_time(tree, hf_afp_spotlight_date, tvb, offset, query_length, &t);
t.secs = query_data64 - SPOTLIGHT_TIME_DELTA;
t.nsecs = 0;
proto_tree_add_time(tree, hf_afp_spotlight_date, tvb, offset, query_length, &t);
offset += query_length;
break;
default:
proto_tree_add_text(tree, tvb, offset, query_length, "type: %s",
spotlight_get_qtype_string(query_type));
offset += query_length;
break;
default:
proto_tree_add_text(tree, tvb, offset, query_length, "type: %s",
spotlight_get_qtype_string(query_type));
offset += query_length;
break;
}
offset += query_length;
break;
}