Fix -Wformat errors in pfctl on 32-bit architectures

Use PRIu64 to printf(3) uint64_t quantities, otherwise this will result
in "error: format specifies type 'unsigned long' but the argument has
type 'uint64_t' (aka 'unsigned long long') [-Werror,-Wformat]" on 32-bit
architectures.

Fixes:		80078d9d38
MFC after:	1 week
This commit is contained in:
Dimitry Andric 2021-08-29 17:31:28 +02:00
parent 395d46caae
commit 5b8f07b12f

View File

@ -578,7 +578,7 @@ print_status(struct pfctl_status *s, struct pfctl_syncookies *cookies, int opts)
printf("%-27s %14s %16s\n", "State Table", "Total", "Rate");
printf(" %-25s %14" PRIu64 " %14s\n", "current entries", s->states, "");
TAILQ_FOREACH(c, &s->fcounters, entry) {
printf(" %-25s %14lu ", c->name, c->counter);
printf(" %-25s %14" PRIu64 " ", c->name, c->counter);
if (runtime > 0)
printf("%14.1f/s\n",
(double)c->counter / (double)runtime);
@ -590,7 +590,7 @@ print_status(struct pfctl_status *s, struct pfctl_syncookies *cookies, int opts)
printf(" %-25s %14" PRIu64 " %14s\n", "current entries",
s->src_nodes, "");
TAILQ_FOREACH(c, &s->scounters, entry) {
printf(" %-25s %14lu ", c->name, c->counter);
printf(" %-25s %14" PRIu64 " ", c->name, c->counter);
if (runtime > 0)
printf("%14.1f/s\n",
(double)c->counter / (double)runtime);