提交 6c6916da 编写于 作者: M Marc-André Lureau 提交者: Michael Roth

qga: use wide-chars constants for wchar_t comparisons

Reported-by: NLaszlo Ersek <lersek@redhat.com>
Signed-off-by: NMarc-André Lureau <marcandre.lureau@redhat.com>
Reviewed-by: NLaszlo Ersek <lersek@redhat.com>
Reviewed-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
Signed-off-by: NMichael Roth <mdroth@linux.vnet.ibm.com>
上级 6771197d
......@@ -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);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册