From b51acf23f9e01d156dba458fbaa0837e646b5969 Mon Sep 17 00:00:00 2001 From: Jonathan Rajotte Date: Thu, 4 Jul 2019 17:27:29 -0400 Subject: [PATCH] Assign *_STATUS_OK to ret 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 Change-Id: I4a08d1bcc2f9b56e225ca17a210a4597169ed746 Reviewed-on: https://review.lttng.org/c/babeltrace/+/1634 Reviewed-by: Philippe Proulx --- src/plugins/text/pretty/pretty.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/plugins/text/pretty/pretty.c b/src/plugins/text/pretty/pretty.c index 089d4871..30fc7be9 100644 --- a/src/plugins/text/pretty/pretty.c +++ b/src/plugins/text/pretty/pretty.c @@ -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( -- 2.34.1