From 9eccbb70ebfc078bf31fbafafbf056ae42c3f037 Mon Sep 17 00:00:00 2001 From: "John F. Carr" Date: Mon, 22 Apr 2024 15:13:44 -0400 Subject: [PATCH] Fix xo_emit format string for percentages The "%lld" format string was used with a value of type long. See https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=278532. --- usr.bin/vmstat/vmstat.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/usr.bin/vmstat/vmstat.c b/usr.bin/vmstat/vmstat.c index 21068d632a8ca0..011d254cd3d11e 100644 --- a/usr.bin/vmstat/vmstat.c +++ b/usr.bin/vmstat/vmstat.c @@ -1103,7 +1103,7 @@ percent(const char *name, long pctv, int *over) { char fmt[64]; - snprintf(fmt, sizeof(fmt), " {:%s/%%%ulld/%%lld}", name, + snprintf(fmt, sizeof(fmt), " {:%s/%%%uld/%%ld}", name, (*over && pctv <= 9) ? 1 : 2); xo_emit(fmt, pctv); if (*over && pctv <= 9)