From 20739dfa44dbb70dcb08e0401a6fc986ca596f93 Mon Sep 17 00:00:00 2001 From: Ruslan Ermilov Date: Thu, 23 Nov 2006 11:51:23 +0000 Subject: [PATCH] Fix the format specifier suitable for uintmax_t. --- sbin/sysctl/sysctl.c | 10 +++++----- usr.bin/systat/vmstat.c | 6 +++--- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/sbin/sysctl/sysctl.c b/sbin/sysctl/sysctl.c index 3f1cf4df5996..7f442a7ec881 100644 --- a/sbin/sysctl/sysctl.c +++ b/sbin/sysctl/sysctl.c @@ -396,18 +396,18 @@ S_vmtotal(int l2, void *p) "%hu Sleep: %hu)\n", v->t_rq, v->t_dw, v->t_pw, v->t_sl); printf( - "Virtual Memory:\t\t(Total: %zuK, Active %zuK)\n", + "Virtual Memory:\t\t(Total: %juK, Active %juK)\n", (uintmax_t)v->t_vm * pageKilo, (uintmax_t)v->t_avm * pageKilo); - printf("Real Memory:\t\t(Total: %zuK Active %zuK)\n", + printf("Real Memory:\t\t(Total: %juK Active %juK)\n", (uintmax_t)v->t_rm * pageKilo, (uintmax_t)v->t_arm * pageKilo); - printf("Shared Virtual Memory:\t(Total: %zuK Active: %zuK)\n", + printf("Shared Virtual Memory:\t(Total: %juK Active: %juK)\n", (uintmax_t)v->t_vmshr * pageKilo, (uintmax_t)v->t_avmshr * pageKilo); - printf("Shared Real Memory:\t(Total: %zuK Active: %zuK)\n", + printf("Shared Real Memory:\t(Total: %juK Active: %juK)\n", (uintmax_t)v->t_rmshr * pageKilo, (uintmax_t)v->t_armshr * pageKilo); - printf("Free Memory Pages:\t%zuK\n", (uintmax_t)v->t_free * pageKilo); + printf("Free Memory Pages:\t%juK\n", (uintmax_t)v->t_free * pageKilo); return (0); } diff --git a/usr.bin/systat/vmstat.c b/usr.bin/systat/vmstat.c index 99ecc1795022..4aac01c3c435 100644 --- a/usr.bin/systat/vmstat.c +++ b/usr.bin/systat/vmstat.c @@ -747,11 +747,11 @@ putuintmax(n, l, lc, w) addch(' '); return; } - snr = snprintf(b, sizeof(b), "%*zu", w, n); + snr = snprintf(b, sizeof(b), "%*ju", w, n); if (snr != w) - snr = snprintf(b, sizeof(b), "%*zuk", w - 1, n / 1000); + snr = snprintf(b, sizeof(b), "%*juk", w - 1, n / 1000); if (snr != w) - snr = snprintf(b, sizeof(b), "%*zuM", w - 1, n / 1000000); + snr = snprintf(b, sizeof(b), "%*juM", w - 1, n / 1000000); if (snr != w) { while (w-- > 0) addch('*');