Received: from eggs.gnu.org ([2001:4830:134:3::10]:57221) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW5Gl-00023g-Ce for qemu-devel@nongnu.org; Wed, 17 Feb 2016 11:48:07 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aW5Gk-0003tL-Bp for qemu-devel@nongnu.org; Wed, 17 Feb 2016 11:48:03 -0500 Received: from mx1.redhat.com ([209.132.183.28]:44470) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aW5Gk-0003t7-6A for qemu-devel@nongnu.org; Wed, 17 Feb 2016 11:48:02 -0500 From: marcandre.lureau@redhat.com Date: Wed, 17 Feb 2016 17:47:53 +0100 Message-Id: <1455727675-20625-4-git-send-email-marcandre.lureau@redhat.com> In-Reply-To: <1455727675-20625-1-git-send-email-marcandre.lureau@redhat.com> References: <1455727675-20625-1-git-send-email-marcandre.lureau@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Subject: [Qemu-devel] [PATCH 3/5] qga: use wide-chars constants for wchar_t comparisons List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , To: qemu-devel@nongnu.org Cc: =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= , lersek@redhat.com, mdroth@linux.vnet.ibm.com From: Marc-Andr=C3=A9 Lureau Reported-by: Laszlo Ersek Signed-off-by: Marc-Andr=C3=A9 Lureau --- 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 !=3D NULL) { nchars =3D wcslen(msg); =20 - if (nchars > 2 && msg[nchars-1] =3D=3D '\n' && msg[nchars-2] =3D= =3D '\r') { - msg[nchars-2] =3D '\0'; + if (nchars > 2 && + msg[nchars - 1] =3D=3D L'\n' && + msg[nchars - 2] =3D=3D L'\r') { + msg[nchars - 2] =3D L'\0'; } =20 retval =3D g_utf16_to_utf8(msg, -1, NULL, NULL, NULL); --=20 2.5.0