Fix: lttng_triggers count is not equal to the size of the sorted trigger array
[lttng-tools.git] / src / bin / lttng / commands / list_triggers.c
index 59db1c5d4b8b499fbd81a5fe10c9ccf9c374da7b..a34323b5e158a268d067e13fb02bf742ce4c9838 100644 (file)
@@ -1191,9 +1191,10 @@ static int print_sorted_triggers(const struct lttng_triggers *triggers)
                        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);
 
This page took 0.023307 seconds and 4 git commands to generate.