]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libsmartcols: remove dead checks
authorIgor Gnatenko <i.gnatenko.brain@gmail.com>
Mon, 19 Dec 2016 22:36:48 +0000 (23:36 +0100)
committerIgor Gnatenko <i.gnatenko.brain@gmail.com>
Mon, 19 Dec 2016 22:36:48 +0000 (23:36 +0100)
We initialize them before.

Signed-off-by: Igor Gnatenko <i.gnatenko.brain@gmail.com>
libsmartcols/src/table_print.c

index c2c178f722670ec15e776857eacece3d919d8ab7..2aff9d181f1f970f9a1d6731154af0557bcc2e19 100644 (file)
@@ -275,7 +275,7 @@ static const char *get_cell_color(struct libscols_table *tb,
        const char *color = NULL;
 
        if (tb && tb->colors_wanted) {
-               if (ce && !color)
+               if (ce)
                        color = ce->color;
                if (ln && !color)
                        color = ln->color;
@@ -455,7 +455,7 @@ static int print_data(struct libscols_table *tb,
        case SCOLS_FMT_JSON:
                fputs_quoted_json_lower(scols_cell_get_data(&cl->header), tb->out);
                fputs(": ", tb->out);
-               if (!data || !*data)
+               if (!*data)
                        fputs("null", tb->out);
                else
                        fputs_quoted_json(data, tb->out);