summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/mir_app/src/netlibsock.cpp6
1 files changed, 1 insertions, 5 deletions
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);
}
}