Commit fb3cc4b5 authored by Poul-Henning Kamp's avatar Poul-Henning Kamp

Make fmt_bytes take an uintmax_t

parent 866b4195
...@@ -283,7 +283,7 @@ tweak_uint(struct cli *cli, const struct parspec *par, const char *arg) ...@@ -283,7 +283,7 @@ tweak_uint(struct cli *cli, const struct parspec *par, const char *arg)
/*--------------------------------------------------------------------*/ /*--------------------------------------------------------------------*/
static void static void
fmt_bytes(struct cli *cli, ssize_t t) fmt_bytes(struct cli *cli, uintmax_t t)
{ {
const char *p; const char *p;
...@@ -298,7 +298,7 @@ fmt_bytes(struct cli *cli, ssize_t t) ...@@ -298,7 +298,7 @@ fmt_bytes(struct cli *cli, ssize_t t)
} }
t /= 1024; t /= 1024;
if (t & 0x0ff) { if (t & 0x0ff) {
VCLI_Out(cli, "%zu%c", t, *p); VCLI_Out(cli, "%ju%c", t, *p);
return; return;
} }
} }
...@@ -324,14 +324,14 @@ tweak_generic_bytes(struct cli *cli, volatile ssize_t *dest, const char *arg, ...@@ -324,14 +324,14 @@ tweak_generic_bytes(struct cli *cli, volatile ssize_t *dest, const char *arg,
} }
if ((uintmax_t)((ssize_t)r) != r || r > max) { if ((uintmax_t)((ssize_t)r) != r || r > max) {
VCLI_Out(cli, "Must be no more than "); VCLI_Out(cli, "Must be no more than ");
fmt_bytes(cli, (ssize_t)max); fmt_bytes(cli, (uintmax_t)max);
VCLI_Out(cli, "\n"); VCLI_Out(cli, "\n");
VCLI_SetResult(cli, CLIS_PARAM); VCLI_SetResult(cli, CLIS_PARAM);
return; return;
} }
if (r < min) { if (r < min) {
VCLI_Out(cli, "Must be at least "); VCLI_Out(cli, "Must be at least ");
fmt_bytes(cli, (ssize_t)min); fmt_bytes(cli, (uintmax_t)min);
VCLI_Out(cli, "\n"); VCLI_Out(cli, "\n");
VCLI_SetResult(cli, CLIS_PARAM); VCLI_SetResult(cli, CLIS_PARAM);
return; return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment