[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 3/5] qga: use wide-chars constants for wchar_t c
From: |
Michael Roth |
Subject: |
Re: [Qemu-devel] [PATCH 3/5] qga: use wide-chars constants for wchar_t comparisons |
Date: |
Wed, 24 Feb 2016 09:35:09 -0600 |
User-agent: |
alot/0.3.6 |
Quoting address@hidden (2016-02-17 10:47:53)
> From: Marc-André Lureau <address@hidden>
>
> Reported-by: Laszlo Ersek <address@hidden>
> Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Michael Roth <address@hidden>
> ---
> qga/commands-win32.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/qga/commands-win32.c b/qga/commands-win32.c
> index e5afc5d..b20f107 100644
> --- a/qga/commands-win32.c
> +++ b/qga/commands-win32.c
> @@ -1266,8 +1266,10 @@ get_net_error_message(gint error)
> if (msg != NULL) {
> nchars = wcslen(msg);
>
> - if (nchars > 2 && msg[nchars-1] == '\n' && msg[nchars-2] == '\r') {
> - msg[nchars-2] = '\0';
> + if (nchars > 2 &&
> + msg[nchars - 1] == L'\n' &&
> + msg[nchars - 2] == L'\r') {
> + msg[nchars - 2] = L'\0';
> }
>
> retval = g_utf16_to_utf8(msg, -1, NULL, NULL, NULL);
> --
> 2.5.0
>
- [Qemu-devel] [PATCH 0/5] qga: win32 guest-set-user-password improvements, marcandre . lureau, 2016/02/17
- [Qemu-devel] [PATCH 1/5] qga: use more idiomatic qemu-style eol operators, marcandre . lureau, 2016/02/17
- [Qemu-devel] [PATCH 2/5] qga: use size_t for wcslen() return value, marcandre . lureau, 2016/02/17
- [Qemu-devel] [PATCH 4/5] qga: fix off-by-one length check, marcandre . lureau, 2016/02/17
- [Qemu-devel] [PATCH 3/5] qga: use wide-chars constants for wchar_t comparisons, marcandre . lureau, 2016/02/17
- Re: [Qemu-devel] [PATCH 3/5] qga: use wide-chars constants for wchar_t comparisons,
Michael Roth <=
- [Qemu-devel] [PATCH 5/5] qga: check utf8-to-utf16 conversion, marcandre . lureau, 2016/02/17
- Re: [Qemu-devel] [PATCH 0/5] qga: win32 guest-set-user-password improvements, Laszlo Ersek, 2016/02/17
- Re: [Qemu-devel] [PATCH 0/5] qga: win32 guest-set-user-password improvements, Michael Roth, 2016/02/24