cutils: Fix size_to_str() on 32-bit platforms
When extracting a human-readable size formatter, we changed 'uint64_t div' pre-patch to 'unsigned long div' post-patch. Which breaks on 32-bit platforms, resulting in 'inf' instead of intended values larger than 999GB. Fixes:stable-4.022951aaa
CC: qemu-stable@nongnu.org Reported-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Eric Blake <eblake@redhat.com> Reviewed-by: Max Reitz <mreitz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com> (cherry picked from commit754da86714
) Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
parent
626a95f4aa
commit
48025d942e
|
@ -825,7 +825,7 @@ const char *qemu_ether_ntoa(const MACAddr *mac)
|
|||
char *size_to_str(uint64_t val)
|
||||
{
|
||||
static const char *suffixes[] = { "", "Ki", "Mi", "Gi", "Ti", "Pi", "Ei" };
|
||||
unsigned long div;
|
||||
uint64_t div;
|
||||
int i;
|
||||
|
||||
/*
|
||||
|
|
Loading…
Reference in New Issue