Fix: sink.text.pretty: assign status at the end of pretty_consume
authorSimon Marchi <simon.marchi@efficios.com>
Wed, 15 Apr 2020 01:23:52 +0000 (21:23 -0400)
committerPhilippe Proulx <eeppeliteloop@gmail.com>
Tue, 21 Apr 2020 19:09:38 +0000 (15:09 -0400)
commit473e4d2acf7f005953af3893bb318222b728412e
tree00461c0e8309539c35d90d5fa72dcbaf05d716e7
parent920b1c3712f983891943ad0102f6c98cbeab66c3
Fix: sink.text.pretty: assign status at the end of pretty_consume

The compiler on SLES 12 reports:

pretty.c:200:2: warning: 'status' may be used uninitialized in this function [-Wmaybe-uninitialized]
  return status;
  ^

We are indeed missing an assignment of status at the end, if everything
went well.  In practice, status has the right value (_OK) from the last
call of handle_message.  But if, for some reason,
bt_message_iterator_next returns OK with 0 messages, then it would stay
unset.  So assigning it explicitly at the end doesn't hurt.

Change-Id: Ic3bf018388f006c919173f9e8942a8ab2384c0f1
Signed-off-by: Simon Marchi <simon.marchi@efficios.com>
Reviewed-on: https://review.lttng.org/c/babeltrace/+/3427
Tested-by: jenkins <jenkins@lttng.org>
Reviewed-by: Philippe Proulx <eeppeliteloop@gmail.com>
src/plugins/text/pretty/pretty.c
This page took 0.024447 seconds and 4 git commands to generate.