qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Qemu-devel] [PATCH v5 03/13] curses: fix wchar_t printf warning


From: Marc-André Lureau
Subject: [Qemu-devel] [PATCH v5 03/13] curses: fix wchar_t printf warning
Date: Fri, 12 Apr 2019 17:36:37 +0200

From: Gerd Hoffmann <address@hidden>

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 <address@hidden>
Signed-off-by: Gerd Hoffmann <address@hidden>
Reviewed-by: Eric Blake <address@hidden>
Reviewed-by: Philippe Mathieu-Daudé <address@hidden>
Message-id: address@hidden
Signed-off-by: Peter Maydell <address@hidden>
---
 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.21.0.313.ge35b8cb8e2




reply via email to

[Prev in Thread] Current Thread [Next in Thread]