Commit 50a24569b88f5cc07f4d382f05fea2dd5e073bf8

Peter Hutterer 2021-11-10T14:45:53

tools/list: print an empty string for null vendor strings Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
diff --git a/tools/registry-list.c b/tools/registry-list.c
index 0c56171..c360da7 100644
--- a/tools/registry-list.c
+++ b/tools/registry-list.c
@@ -140,11 +140,12 @@ main(int argc, char **argv)
     m = rxkb_model_first(ctx);
     assert(m); /* Empty model list is usually a bug or a bad xml file */
     while (m) {
+        const char *vendor = rxkb_model_get_vendor(m);
         printf("- name: %s\n"
                "  vendor: %s\n"
                "  description: %s\n",
                rxkb_model_get_name(m),
-               rxkb_model_get_vendor(m),
+               vendor ? vendor : "''",
                rxkb_model_get_description(m));
         m = rxkb_model_next(m);
     }