Since anonymous triggers can be present in the original lttng_triggers
and that we do not add them to the sorting list, the count to be used
while iterating on the sorted list must be the size of the list itself
and not that of lttng_triggers.
Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Signed-off-by: Jérémie Galarneau <jeremie.galarneau@efficios.com>
Change-Id: Ifb1802345199cb20fbb6d401f316be918b8a6443
sizeof(struct lttng_trigger *),
compare_triggers_by_name);
- for (i = 0; i < num_triggers; i++) {
- const struct lttng_trigger *trigger_to_print =
- (const struct lttng_trigger *)
+ for (i = 0; i < lttng_dynamic_pointer_array_get_count(&sorted_triggers);
+ i++) {
+ const struct lttng_trigger *trigger_to_print = (const struct lttng_trigger
+ *)
lttng_dynamic_pointer_array_get_pointer(
&sorted_triggers, i);