Assign *_STATUS_OK to ret
authorJonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Thu, 4 Jul 2019 21:27:29 +0000 (17:27 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Thu, 4 Jul 2019 21:52:44 +0000 (17:52 -0400)
pretty.c:227 'ret' may be used uninitialized in this function [-Wmaybe-uninitialized]

This *could* happen if next_status is BT_MESSAGE_ITERATOR_NEXT_STATUS_OK
and count is still 0.

Signed-off-by: Jonathan Rajotte <jonathan.rajotte-julien@efficios.com>
Change-Id: I4a08d1bcc2f9b56e225ca17a210a4597169ed746
Reviewed-on: https://review.lttng.org/c/babeltrace/+/1634
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/text/pretty/pretty.c

index 089d4871a97ff9e93033377a210d49d3309cf8d0..30fc7be9701dd850c4c2664e759d2d5c7d2e991c 100644 (file)
@@ -178,7 +178,8 @@ BT_HIDDEN
 bt_component_class_sink_consume_method_status pretty_consume(
                bt_self_component_sink *comp)
 {
-       bt_component_class_sink_consume_method_status ret;
+       bt_component_class_sink_consume_method_status ret =
+               BT_COMPONENT_CLASS_SINK_CONSUME_METHOD_STATUS_OK;
        bt_message_array_const msgs;
        bt_self_component_port_input_message_iterator *it;
        struct pretty_component *pretty = bt_self_component_get_data(
This page took 0.027443 seconds and 4 git commands to generate.