From 2850da733d35b4b21aff914f3565ca3d870c9f37 Mon Sep 17 00:00:00 2001 From: "H. Peter Anvin (Intel)" Date: Thu, 9 Jul 2020 17:44:21 -0700 Subject: [PATCH] vsnprintf.c: fix printing of a size_t variable printf("%d", ) 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) --- stdlib/vsnprintf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/vsnprintf.c b/stdlib/vsnprintf.c index 284cc194..58de6515 100644 --- a/stdlib/vsnprintf.c +++ b/stdlib/vsnprintf.c @@ -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; }