[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PULL 6/9] qga: use wide-chars constants for wchar_t compar
From: |
Michael Roth |
Subject: |
[Qemu-devel] [PULL 6/9] qga: use wide-chars constants for wchar_t comparisons |
Date: |
Thu, 25 Feb 2016 11:11:58 -0600 |
From: Marc-André Lureau <address@hidden>
Reported-by: Laszlo Ersek <address@hidden>
Signed-off-by: Marc-André Lureau <address@hidden>
Reviewed-by: Laszlo Ersek <address@hidden>
Reviewed-by: Michael Roth <address@hidden>
Signed-off-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 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
- [Qemu-devel] [PULL 0/9] qemu-ga patch queue for 2.6, Michael Roth, 2016/02/25
- [Qemu-devel] [PULL 3/9] qga: implement the guest-get-vcpus for windows, Michael Roth, 2016/02/25
- [Qemu-devel] [PULL 1/9] qga: Support enum names in guest-file-seek, Michael Roth, 2016/02/25
- [Qemu-devel] [PULL 9/9] qga: fix w32 breakage due to missing osdep.h includes, Michael Roth, 2016/02/25
- [Qemu-devel] [PULL 7/9] qga: fix off-by-one length check, Michael Roth, 2016/02/25
- [Qemu-devel] [PULL 5/9] qga: use size_t for wcslen() return value, Michael Roth, 2016/02/25
- [Qemu-devel] [PULL 2/9] qemu-ga: Fixed minor version switch issue, Michael Roth, 2016/02/25
- [Qemu-devel] [PULL 8/9] qga: check utf8-to-utf16 conversion, Michael Roth, 2016/02/25
- [Qemu-devel] [PULL 6/9] qga: use wide-chars constants for wchar_t comparisons,
Michael Roth <=
- [Qemu-devel] [PULL 4/9] qga: use more idiomatic qemu-style eol operators, Michael Roth, 2016/02/25
- Re: [Qemu-devel] [PULL 0/9] qemu-ga patch queue for 2.6, Peter Maydell, 2016/02/25