From 110013b2aea121b25343329bc5094c1d22609f4f Mon Sep 17 00:00:00 2001 From: Connection Refused Date: Thu, 14 Oct 2021 18:08:37 +0800 Subject: [PATCH] [Redirector] Optimize code --- Redirector/DNSHandler.cpp | 2 +- Redirector/Redirector.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Redirector/DNSHandler.cpp b/Redirector/DNSHandler.cpp index 6c5ce5a1..14d0bf7b 100644 --- a/Redirector/DNSHandler.cpp +++ b/Redirector/DNSHandler.cpp @@ -58,7 +58,7 @@ bool DNSHandler::INIT() return true; } - printf("[Redirector][DNSHandler::INIT] Convert string to address failed: %d\n", WSAGetLastError()); + cout << "[Redirector][DNSHandler::INIT] Convert address failed: " << WSAGetLastError() << " [" << dnsHost << ":" << dnsPort << "]" << endl; return false; } diff --git a/Redirector/Redirector.cpp b/Redirector/Redirector.cpp index f0090cf6..dff9e593 100644 --- a/Redirector/Redirector.cpp +++ b/Redirector/Redirector.cpp @@ -103,7 +103,7 @@ extern "C" { dnsHost = ws2s(value); break; case AIO_DNSPORT: - dnsPort = (USHORT)atoi(ws2s(value).c_str()); + dnsPort = static_cast(atoi(ws2s(value).c_str())); break; case AIO_TGTHOST: tgtHost = wstring(value);