From: Simon Marchi Date: Fri, 25 Oct 2019 21:56:36 +0000 (-0400) Subject: cli: Remove unnecessary NULL check in print_value_rec X-Git-Tag: v2.0.0-rc2~20 X-Git-Url: http://git.efficios.com/?p=babeltrace.git;a=commitdiff_plain;h=59bd183253d6b72a6581998c088d0581d158ccd3 cli: Remove unnecessary NULL check in print_value_rec There's no reason for `value` to legitimately be NULL here. Replace that with an assert so we can catch eventual mistakes. Change-Id: I9272c4c5e862601d7c9c7b9c67a1cf332ee1770b Signed-off-by: Simon Marchi Reviewed-on: https://review.lttng.org/c/babeltrace/+/2265 Reviewed-by: Francis Deslauriers --- diff --git a/src/cli/babeltrace2.c b/src/cli/babeltrace2.c index c63a16c7..150b08fc 100644 --- a/src/cli/babeltrace2.c +++ b/src/cli/babeltrace2.c @@ -336,9 +336,7 @@ void print_value_rec(FILE *fp, const bt_value *value, size_t indent) const char *str_val; GPtrArray *map_keys = NULL; - if (!value) { - goto end; - } + BT_ASSERT(value); switch (bt_value_get_type(value)) { case BT_VALUE_TYPE_NULL: