From: Karel Zak Date: Fri, 15 Sep 2017 10:28:44 +0000 (+0200) Subject: rfkill: fix coding style and error messages X-Git-Tag: v2.31-rc1~77 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=e8f6060f27990881390c8ff4aa4c3aeae00da7b6;p=thirdparty%2Futil-linux.git rfkill: fix coding style and error messages Signed-off-by: Karel Zak --- diff --git a/sys-utils/rfkill.c b/sys-utils/rfkill.c index 7914c43093..1379b6b6fd 100644 --- a/sys-utils/rfkill.c +++ b/sys-utils/rfkill.c @@ -311,7 +311,10 @@ static void fill_table_row(struct libscols_table *tb, struct rfkill_event *event static void rfkill_list_init(struct control *ctrl) { + size_t i; + scols_init_debug(0); + ctrl->tb = scols_new_table(); if (!ctrl->tb) err(EXIT_FAILURE, _("failed to allocate output table")); @@ -319,15 +322,12 @@ static void rfkill_list_init(struct control *ctrl) scols_table_enable_json(ctrl->tb, ctrl->json); scols_table_enable_noheadings(ctrl->tb, ctrl->no_headings); scols_table_enable_raw(ctrl->tb, ctrl->raw); - { - size_t i; - for (i = 0; i < (size_t)ncolumns; i++) { - const struct colinfo *col = get_column_info(i); + for (i = 0; i < (size_t) ncolumns; i++) { + const struct colinfo *col = get_column_info(i); - if (!scols_table_new_column(ctrl->tb, col->name, col->whint, col->flags)) - err(EXIT_FAILURE, _("failed to initialize output column")); - } + if (!scols_table_new_column(ctrl->tb, col->name, col->whint, col->flags)) + err(EXIT_FAILURE, _("failed to allocate output column")); } }