From 18954fdc70a02c38e470221b0a33b612b1be06f7 Mon Sep 17 00:00:00 2001 From: Matthew Flatt Date: Tue, 26 Jan 2021 05:59:03 -0700 Subject: [PATCH] Chez Scheme: fix compilation problems for MinGW --- racket/src/ChezScheme/c/windows.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/racket/src/ChezScheme/c/windows.c b/racket/src/ChezScheme/c/windows.c index af5dd072d5..23c0c20acb 100644 --- a/racket/src/ChezScheme/c/windows.c +++ b/racket/src/ChezScheme/c/windows.c @@ -255,8 +255,8 @@ static ptr s_ErrorStringImp(DWORD dwMessageId, const char *lpcDefault) { } else { /* ...otherwise, use the error code in hexadecimal. */ char buf[(sizeof(dwMessageId) * 2) + 3]; - int n = snprintf(buf, sizeof(buf), "0x%x", dwMessageId); - if (n < sizeof(buf)) + int n = snprintf(buf, sizeof(buf), "0x%lx", dwMessageId); + if ((unsigned)n < sizeof(buf)) return Sstring_utf8(buf, n); else return Sstring("??");