diff options
author | Manuel Bentele | 2021-12-07 10:17:15 +0100 |
---|---|---|
committer | Manuel Bentele | 2021-12-07 10:17:15 +0100 |
commit | 424839be05e2f4c5d4684ab0c37e00c2881672bd (patch) | |
tree | b6fa21c4f6f5a64782f941c4eaf4ae67c7995f89 /src/utils/libsmartcols/src/print-api.c | |
parent | Fix issue in CMake kernel header check (diff) | |
download | xloop-424839be05e2f4c5d4684ab0c37e00c2881672bd.tar.gz xloop-424839be05e2f4c5d4684ab0c37e00c2881672bd.tar.xz xloop-424839be05e2f4c5d4684ab0c37e00c2881672bd.zip |
Update xlosetup from util-linux v2.37.2
Diffstat (limited to 'src/utils/libsmartcols/src/print-api.c')
-rw-r--r-- | src/utils/libsmartcols/src/print-api.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/utils/libsmartcols/src/print-api.c b/src/utils/libsmartcols/src/print-api.c index 89dd3bf..237d9ae 100644 --- a/src/utils/libsmartcols/src/print-api.c +++ b/src/utils/libsmartcols/src/print-api.c @@ -119,8 +119,8 @@ static int do_print_table(struct libscols_table *tb, int *is_empty) if (scols_table_is_json(tb)) { ul_jsonwrt_init(&tb->json, tb->out, 0); ul_jsonwrt_root_open(&tb->json); - ul_jsonwrt_array_open(&tb->json, tb->name); - ul_jsonwrt_array_close(&tb->json, 1); + ul_jsonwrt_array_open(&tb->json, tb->name ? tb->name : ""); + ul_jsonwrt_array_close(&tb->json); ul_jsonwrt_root_close(&tb->json); } else if (is_empty) *is_empty = 1; @@ -134,7 +134,7 @@ static int do_print_table(struct libscols_table *tb, int *is_empty) if (scols_table_is_json(tb)) { ul_jsonwrt_root_open(&tb->json); - ul_jsonwrt_array_open(&tb->json, tb->name); + ul_jsonwrt_array_open(&tb->json, tb->name ? tb->name : ""); } if (tb->format == SCOLS_FMT_HUMAN) @@ -150,7 +150,7 @@ static int do_print_table(struct libscols_table *tb, int *is_empty) rc = __scols_print_table(tb, buf); if (scols_table_is_json(tb)) { - ul_jsonwrt_array_close(&tb->json, 1); + ul_jsonwrt_array_close(&tb->json); ul_jsonwrt_root_close(&tb->json); } done: |