summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-09-13 16:55:58 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-09-13 16:55:58 +0000
commit3b4d73751f2bdce3b26d070ea5b4a7eae3a3b750 (patch)
treeb45162827fe8e5ca29c495d0a6d24f111e212c2e
parent16cdfa5e933566f2181fecc764b74a01b869d793 (diff)
minor code cleaning
git-svn-id: http://svn.miranda-ng.org/main/trunk@15347 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
-rw-r--r--protocols/JabberG/src/jabber_thread.cpp6
-rw-r--r--src/mir_app/src/netlibsock.cpp6
2 files changed, 4 insertions, 8 deletions
diff --git a/protocols/JabberG/src/jabber_thread.cpp b/protocols/JabberG/src/jabber_thread.cpp
index 9122ce016d..9a61d52b99 100644
--- a/protocols/JabberG/src/jabber_thread.cpp
+++ b/protocols/JabberG/src/jabber_thread.cpp
@@ -155,10 +155,9 @@ void ThreadData::xmpp_client_query(void)
if (SUCCEEDED(status) && results) {
LIST<DNS_SRV_DATAA> dnsList(5, CompareDNS);
- for (DNS_RECORDA *rec = results; rec; rec = rec->pNext) {
+ for (DNS_RECORDA *rec = results; rec; rec = rec->pNext)
if (rec->Data.Srv.pNameTarget && rec->wType == DNS_TYPE_SRV)
dnsList.insert(&rec->Data.Srv);
- }
for (int i = 0; i < dnsList.getCount(); i++) {
WORD dnsPort = (conn.port == 0 || conn.port == 5222) ? dnsList[i]->wPort : conn.port;
@@ -170,7 +169,8 @@ void ThreadData::xmpp_client_query(void)
strncpy_s(conn.manualHost, dnsHost, _TRUNCATE);
conn.port = dnsPort;
break;
- } }
+ }
+ }
DnsRecordListFree(results, DnsFreeRecordList);
}
else proto->debugLogA("%s not resolved", temp);
diff --git a/src/mir_app/src/netlibsock.cpp b/src/mir_app/src/netlibsock.cpp
index c130bcf754..9cf7311dd9 100644
--- a/src/mir_app/src/netlibsock.cpp
+++ b/src/mir_app/src/netlibsock.cpp
@@ -234,11 +234,7 @@ void NetlibGetConnectionInfo(NetlibConnection *nlc, NETLIBCONNINFO *connInfo)
if (!getsockname(nlc->s, (PSOCKADDR)&sin, &len)) {
connInfo->wPort = ntohs(sin.Ipv4.sin_port);
connInfo->dwIpv4 = sin.si_family == AF_INET ? htonl(sin.Ipv4.sin_addr.s_addr) : 0;
-
- char *szTmp = NetlibAddressToString(&sin);
- strncpy(connInfo->szIpPort, szTmp, sizeof(connInfo->szIpPort));
- connInfo->szIpPort[sizeof(connInfo->szIpPort) - 1] = 0;
- mir_free(szTmp);
+ strncpy_s(connInfo->szIpPort, ptrA(NetlibAddressToString(&sin)), _TRUNCATE);
}
}