]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
test-tables: fix warning about NULL used in printf
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 10 Feb 2021 06:49:17 +0000 (07:49 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 10 Feb 2021 13:43:10 +0000 (14:43 +0100)
With the simplified asserts, newer gcc is able to (correctly) figure
out that NULL was being passed.

src/shared/test-tables.h

index bb8177b6492e9e6de27dbe3d0317f935b6607e9a..120dc7f2e9f1f350c83e62491df935ef8595250a 100644 (file)
@@ -27,7 +27,7 @@ static inline void _test_table(const char *name,
                 }
 
                 if (boring < 1 || i == size)
-                        printf("%s: %d → %s → %d\n", name, i, val, rev);
+                        printf("%s: %d → %s → %d\n", name, i, strnull(val), rev);
                 else if (boring == 1)
                         printf("%*s  ...\n", (int) strlen(name), "");