]> git.ipfire.org Git - thirdparty/systemd.git/commitdiff
networkd: fix two format string mismatches
authorZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 1 Nov 2017 21:43:32 +0000 (22:43 +0100)
committerZbigniew Jędrzejewski-Szmek <zbyszek@in.waw.pl>
Wed, 1 Nov 2017 22:10:21 +0000 (23:10 +0100)
../src/network/networkd-link.c:3577:84: warning: format specifies type 'unsigned char' but the argument has type 'uint32_t' (aka 'unsigned int') [-Wformat]
                                route->dst_prefixlen, route->tos, route->priority, route->table, route->lifetime);
                                                                                   ^~~~~~~~~~~~
../src/network/networkd-manager.c:1146:132: warning: format specifies type 'unsigned char' but the argument has type 'uint32_t' (aka 'unsigned int') [-Wformat]
                        rule->from_prefixlen, space ? " " : "", to_str, rule->to_prefixlen, rule->tos, rule->fwmark, rule->fwmask, rule->table);
                                                                                                                                   ^~~~~~~~~~~

Also add some line breaks to make it easier to see which argument is for which
part of the format string.

src/network/networkd-link.c
src/network/networkd-manager.c

index 70039940bc55ba1238ff499b3f6d70002c1fe94e..fd063e43d261a11c9142791705c16f1c12a8b5a7 100644 (file)
@@ -3573,7 +3573,8 @@ int link_save(Link *link) {
                         if (r < 0)
                                 goto fail;
 
-                        fprintf(f, "%s%s/%hhu/%hhu/%"PRIu32"/%hhu/"USEC_FMT, space ? " " : "", route_str,
+                        fprintf(f, "%s%s/%hhu/%hhu/%"PRIu32"/%"PRIu32"/"USEC_FMT,
+                                space ? " " : "", route_str,
                                 route->dst_prefixlen, route->tos, route->priority, route->table, route->lifetime);
                         space = true;
                 }
index 200d0f622d57ddaec3e1adffef606d7db0ba69dd..574bd0f5cbe5f8bf063fe3438bef1d9ee105e9c6 100644 (file)
@@ -1142,8 +1142,12 @@ static int manager_save(Manager *m) {
                                 goto fail;
                 }
 
-                fprintf(f, "from=%s%s/%hhu to=%s%s/%hhu tos=%hhu fwmark=%"PRIu32"/%"PRIu32" table=%hhu", space ? " " : "", from_str,
-                        rule->from_prefixlen, space ? " " : "", to_str, rule->to_prefixlen, rule->tos, rule->fwmark, rule->fwmask, rule->table);
+                fprintf(f, "from=%s%s/%hhu to=%s%s/%hhu tos=%hhu fwmark=%"PRIu32"/%"PRIu32" table=%"PRIu32,
+                        space ? " " : "", from_str, rule->from_prefixlen,
+                        space ? " " : "", to_str, rule->to_prefixlen,
+                        rule->tos,
+                        rule->fwmark, rule->fwmask,
+                        rule->table);
 
                 fputc('\n', f);
         }