]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
libsmartcols: handle nameless tables in export format
authorThomas Weißschuh <thomas@t-8ch.de>
Fri, 22 Sep 2023 09:20:36 +0000 (11:20 +0200)
committerThomas Weißschuh <thomas@t-8ch.de>
Fri, 22 Sep 2023 18:31:28 +0000 (20:31 +0200)
fputs(NULL) is not allowed.

Signed-off-by: Thomas Weißschuh <thomas@t-8ch.de>
libsmartcols/src/print.c

index 906df7e2a9f4d889f73f629b3f56e3367ea570fb..6a7e6da04518adc00a8397273919d51f44b1a2e4 100644 (file)
@@ -627,7 +627,7 @@ static int print_data(struct libscols_table *tb,
                return 0;
 
        case SCOLS_FMT_EXPORT:
-               fputs(name, tb->out);
+               fputs(name ?: "", tb->out);
                fputc('=', tb->out);
                fputs_quoted(data, tb->out);
                if (!is_last)