From e8f6060f27990881390c8ff4aa4c3aeae00da7b6 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Fri, 15 Sep 2017 12:28:44 +0200 Subject: [PATCH] rfkill: fix coding style and error messages Signed-off-by: Karel Zak --- sys-utils/rfkill.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) 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")); } } -- 2.47.3