summaryrefslogtreecommitdiff
path: root/src/network/core
diff options
context:
space:
mode:
authorrubidium <rubidium@openttd.org>2008-09-29 16:27:02 +0000
committerrubidium <rubidium@openttd.org>2008-09-29 16:27:02 +0000
commit5ab74534da3f94cd1c43bc438dcc0d31b23408e5 (patch)
tree43b0c8873ef3d08bb3099e46a3bc152bc8cd010d /src/network/core
parentd34da3cadbd0e7776244fc45915f23b1e9f28c7f (diff)
downloadopenttd-5ab74534da3f94cd1c43bc438dcc0d31b23408e5.tar.xz
(svn r14414) -Fix: replace instances of strncpy with strecpy as strncpy doesn't guarantee the resulting string is '\0'-terminated.
Diffstat (limited to 'src/network/core')
-rw-r--r--src/network/core/host.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/network/core/host.cpp b/src/network/core/host.cpp
index 70e9f57c7..5308bce04 100644
--- a/src/network/core/host.cpp
+++ b/src/network/core/host.cpp
@@ -162,7 +162,7 @@ static int NetworkFindBroadcastIPsInternal(uint32 *broadcast, int limit) // !GET
if (req->ifr_addr.sa_family == AF_INET) {
struct ifreq r;
- strncpy(r.ifr_name, req->ifr_name, lengthof(r.ifr_name));
+ strecpy(r.ifr_name, req->ifr_name, lastof(r.ifr_name));
if (ioctl(sock, SIOCGIFFLAGS, &r) != -1 &&
r.ifr_flags & IFF_BROADCAST &&
ioctl(sock, SIOCGIFBRDADDR, &r) != -1) {