Commit e1be9854 authored by Gerd Hoffmann's avatar Gerd Hoffmann Committed by Peter Maydell
Browse files

curses: fix wchar_t printf warning



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: default avatarMark Cave-Ayland <mark.cave-ayland@ilande.co.uk>
Signed-off-by: default avatarGerd Hoffmann <kraxel@redhat.com>
Reviewed-by: default avatarEric Blake <eblake@redhat.com>
Reviewed-by: default avatarPhilippe Mathieu-Daudé <philmd@redhat.com>
Message-id: 20190402073018.17747-1-kraxel@redhat.com
Signed-off-by: default avatarPeter Maydell <peter.maydell@linaro.org>
parent 9e4a484b
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -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;
    }