git: 2da6a6b31d9c - main - nvmecontrol: use uintmax_t for a size
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Sat, 08 Oct 2022 03:45:03 UTC
The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=2da6a6b31d9ce242151bf025a38ddd5c6887f0a3 commit 2da6a6b31d9ce242151bf025a38ddd5c6887f0a3 Author: Warner Losh <imp@FreeBSD.org> AuthorDate: 2022-10-08 03:41:02 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2022-10-08 03:44:23 +0000 nvmecontrol: use uintmax_t for a size Use uintmax_t cast to print the size of the device for the non-humanize case to avoid issues with 32-bit longs. Fixes: 9c1bec9c21a2 Sponsored by: Netflix --- sbin/nvmecontrol/devlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sbin/nvmecontrol/devlist.c b/sbin/nvmecontrol/devlist.c index e9df5faadb12..61e6dd47ef8e 100644 --- a/sbin/nvmecontrol/devlist.c +++ b/sbin/nvmecontrol/devlist.c @@ -143,7 +143,7 @@ devlist(const struct cmd *f, int argc, char *argv[]) printf(" %10s (%s)\n", name, buf); } else { - printf(" %10s (%luMB)\n", name, size / 1024 / 1024); + printf(" %10s (%juMB)\n", name, (uintmax_t)size / 1024 / 1024); } }