[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PULL 2/2] curses: add option to specify VGA font encod
From: |
Peter Maydell |
Subject: |
Re: [Qemu-devel] [PULL 2/2] curses: add option to specify VGA font encoding |
Date: |
Thu, 14 Mar 2019 16:54:36 +0000 |
On Wed, 13 Mar 2019 at 07:38, Gerd Hoffmann <address@hidden> wrote:
>
> From: Samuel Thibault <address@hidden>
>
> This uses iconv to convert glyphs from the specified VGA font encoding to
> unicode, and makes use of cchar_t instead of chtype when using ncursesw,
> which allows to store all wide char as well as the WACS values. The default
> charset is made CP437 since that is the charset of the hardware default VGA
> font. This also makes the curses backend set the LC_CTYPE locale to "" to
> allow curses to emit wide characters.
Hi; Coverity points out an issue in font_setup()
(CID 1399708, 1399709, 1399713):
> +/*
> + * Setup mapping for vga to curses line graphics.
> + */
> +static void font_setup(void)
> +{
> + iconv_t ucs_to_wchar_conv;
> + iconv_t wchar_to_ucs_conv;
> + iconv_t font_conv;
> + int i;
> +
> + ucs_to_wchar_conv = iconv_open("WCHAR_T", "UCS-2");
We call iconv_open() here (and below for wchar_to_ucs_conv and font_conv),
but in the success case we just return from the function without ever
calling iconv_close().
thanks
-- PMM