vsnprintf.c: fix printing of a size_t variable

printf("%d", <size_t>) is invalid. As this is for legacy compilers,
don't rely on %zu but rather cast to unsigned long long.

Signed-off-by: H. Peter Anvin (Intel) <hpa@zytor.com>
This commit is contained in:
H. Peter Anvin (Intel) 2020-07-09 17:44:21 -07:00
parent 91bc518895
commit 2850da733d

View file

@ -22,8 +22,8 @@ int vsnprintf(char *str, size_t size, const char *format, va_list ap)
int rv, bytes; int rv, bytes;
if (size > BUFFER_SIZE) { if (size > BUFFER_SIZE) {
nasm_panic("vsnprintf: size (%d) > BUFFER_SIZE (%d)", nasm_panic("vsnprintf: size (%llu) > BUFFER_SIZE (%d)",
size, BUFFER_SIZE); (unsigned long long)size, BUFFER_SIZE);
size = BUFFER_SIZE; size = BUFFER_SIZE;
} }