networkd: fix two format string mismatches

../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.
This commit is contained in:
Zbigniew Jędrzejewski-Szmek 2017-11-01 22:43:32 +01:00
parent 3dad3203ab
commit ecc3f340ab
2 changed files with 8 additions and 3 deletions

View 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;
}

View 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);
}