Fix the format specifier suitable for uintmax_t.

This commit is contained in:
Ruslan Ermilov 2006-11-23 11:51:23 +00:00
parent 9623c97258
commit 20739dfa44
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=164557
2 changed files with 8 additions and 8 deletions

View File

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

View File

@ -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('*');