aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarc-André Lureau <marcandre.lureau@redhat.com>2016-02-17 17:47:53 +0100
committerMichael Roth <mdroth@linux.vnet.ibm.com>2016-02-25 09:48:51 -0600
commit6c6916dac8a146f2e8ee845a2a4e8d459a8689eb (patch)
treee946cf4c710bfb9d9ee07cf4aaea2389da66018b
parent6771197dffb214cf9ac5de825bbb24ff5dcc70c2 (diff)
qga: use wide-chars constants for wchar_t comparisons
Reported-by: Laszlo Ersek <lersek@redhat.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com> Reviewed-by: Michael Roth <mdroth@linux.vnet.ibm.com> Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
-rw-r--r--qga/commands-win32.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/qga/commands-win32.c b/qga/commands-win32.c
index 1086ac92a8..2df1e2d61b 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);