]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
lsfd: don't define a local variable in the middle of a block
authorMasatake YAMATO <yamato@redhat.com>
Sat, 13 Nov 2021 10:14:34 +0000 (19:14 +0900)
committerMasatake YAMATO <yamato@redhat.com>
Thu, 18 Nov 2021 14:52:46 +0000 (23:52 +0900)
Signed-off-by: Masatake YAMATO <yamato@redhat.com>
misc-utils/lsfd.c

index fc721982e6bf11ea097849b7ed56898d50f4f0b7..111abd6027a8bdf5ff53e7f644c9070397eb1859 100644 (file)
@@ -253,12 +253,14 @@ static struct libscols_column *add_column(struct libscols_table *tb, const struc
 
 static struct libscols_column *add_column_by_id_cb(struct libscols_table *tb, int colid, void *data)
 {
+       struct libscols_column *cl;
+
        if (ncolumns >= ARRAY_SIZE(columns))
                errx(EXIT_FAILURE, _("too many columns are added via filter expression"));
 
        assert(colid < LSFD_N_COLS);
 
-       struct libscols_column *cl = add_column(tb, infos + colid);
+       cl = add_column(tb, infos + colid);
        if (!cl)
                err(EXIT_FAILURE, _("failed to allocate output column"));
        columns[ncolumns++] = colid;