From e1be98540ee672ef93292b65a986055512237c35 Mon Sep 17 00:00:00 2001 From: Gerd Hoffmann Date: Tue, 2 Apr 2019 09:30:18 +0200 Subject: [PATCH] curses: fix wchar_t printf warning MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit On some systems wchar_t is "long int", on others just "int". So go cast to "long int" and adjust the printf format accordingly. Reported-by: Mark Cave-Ayland Signed-off-by: Gerd Hoffmann Reviewed-by: Eric Blake Reviewed-by: Philippe Mathieu-Daudé Message-id: 20190402073018.17747-1-kraxel@redhat.com Signed-off-by: Peter Maydell --- ui/curses.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ui/curses.c b/ui/curses.c index cc6d6da684..fb63945188 100644 --- a/ui/curses.c +++ b/ui/curses.c @@ -453,8 +453,8 @@ static uint16_t get_ucs(wchar_t wch, iconv_t conv) swch = sizeof(wch); if (iconv(conv, &pwch, &swch, &pch, &sch) == (size_t) -1) { - fprintf(stderr, "Could not convert 0x%02x from WCHAR_T to UCS-2: %s\n", - wch, strerror(errno)); + fprintf(stderr, "Could not convert 0x%02lx from WCHAR_T to UCS-2: %s\n", + (unsigned long)wch, strerror(errno)); return 0xFFFD; } -- 2.39.2