[Openvpn-devel,v1] openvpnserv: fix log lines format string
Commit Message
From: Heiko Hund <heiko@ist.eigentlich.net>
The interface name is UTF-8 encoded. In order to log it correctly,
it needs to be converted to UTF-16 first.
Change-Id: Iec392a47123d618c0dbc3a5241c39da4ac83d880
Signed-off-by: Heiko Hund <heiko@ist.eigentlich.net>
Acked-by: Razvan Cojocaru <razvanc@mailbox.org>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1861
---
This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1861
This mail reflects revision 1 of this Change.
Acked-by according to Gerrit (reflected above):
Razvan Cojocaru <razvanc@mailbox.org>
@@ -1224,19 +1224,25 @@
err = InterfaceLuid(itf_name, &luid);
if (err)
{
- MsgToEventLog(M_ERR, L"%S: failed to convert itf alias '%s'", __func__, itf_name);
+ PWSTR wide_name = utf8to16(itf_name);
+ MsgToEventLog(M_ERR, L"%S: failed to convert itf alias '%s'", __func__, wide_name);
+ free(wide_name);
goto out;
}
err = ConvertInterfaceLuidToGuid(&luid, &guid);
if (err)
{
- MsgToEventLog(M_ERR, L"%S: Failed to convert itf '%s' LUID", __func__, itf_name);
+ PWSTR wide_name = utf8to16(itf_name);
+ MsgToEventLog(M_ERR, L"%S: Failed to convert itf '%s' LUID", __func__, wide_name);
+ free(wide_name);
goto out;
}
if (StringFromIID(&guid, &iid_str) != S_OK)
{
- MsgToEventLog(M_ERR, L"%S: Failed to convert itf '%s' IID", __func__, itf_name);
+ PWSTR wide_name = utf8to16(itf_name);
+ MsgToEventLog(M_ERR, L"%S: Failed to convert itf '%s' IID", __func__, wide_name);
+ free(wide_name);
err = ERROR_OUTOFMEMORY;
goto out;
}