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;
if (size > BUFFER_SIZE) {
nasm_panic("vsnprintf: size (%d) > BUFFER_SIZE (%d)",
size, BUFFER_SIZE);
nasm_panic("vsnprintf: size (%llu) > BUFFER_SIZE (%d)",
(unsigned long long)size, BUFFER_SIZE);
size = BUFFER_SIZE;
}