From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from eggs.gnu.org ([2001:4830:134:3::10]:47068) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYzUV-0006gx-5I for qemu-devel@nongnu.org; Thu, 25 Feb 2016 12:14:18 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1aYzUR-0001nr-PK for qemu-devel@nongnu.org; Thu, 25 Feb 2016 12:14:15 -0500 Received: from e38.co.us.ibm.com ([32.97.110.159]:32851) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1aYzUR-0001nc-C5 for qemu-devel@nongnu.org; Thu, 25 Feb 2016 12:14:11 -0500 Received: from localhost by e38.co.us.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 25 Feb 2016 10:14:09 -0700 Received: from b03cxnp08025.gho.boulder.ibm.com (b03cxnp08025.gho.boulder.ibm.com [9.17.130.17]) by d03dlp03.boulder.ibm.com (Postfix) with ESMTP id 6EB5019D803F for ; Thu, 25 Feb 2016 10:02:00 -0700 (MST) Received: from d03av05.boulder.ibm.com (d03av05.boulder.ibm.com [9.17.195.85]) by b03cxnp08025.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id u1PHE3Br33292340 for ; Thu, 25 Feb 2016 10:14:03 -0700 Received: from d03av05.boulder.ibm.com (localhost [127.0.0.1]) by d03av05.boulder.ibm.com (8.14.4/8.14.4/NCO v10.0 AVout) with ESMTP id u1PHE1Mh021035 for ; Thu, 25 Feb 2016 10:14:02 -0700 From: Michael Roth Date: Thu, 25 Feb 2016 11:11:58 -0600 Message-Id: <1456420321-20924-7-git-send-email-mdroth@linux.vnet.ibm.com> In-Reply-To: <1456420321-20924-1-git-send-email-mdroth@linux.vnet.ibm.com> References: <1456420321-20924-1-git-send-email-mdroth@linux.vnet.ibm.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Subject: [Qemu-devel] [PULL 6/9] 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: peter.maydell@linaro.org, Michael Roth , =?UTF-8?q?Marc-Andr=C3=A9=20Lureau?= From: Marc-André Lureau Reported-by: Laszlo Ersek Signed-off-by: Marc-André Lureau Reviewed-by: Laszlo Ersek Reviewed-by: Michael Roth Signed-off-by: Michael Roth --- 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 1086ac9..2df1e2d 100644 --- a/qga/commands-win32.c +++ b/qga/commands-win32.c @@ -1323,8 +1323,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); -- 1.9.1