1
0
mirror of https://github.com/OpenTTD/OpenTTD.git synced 2025-08-19 20:49:11 +00:00

(svn r14414) -Fix: replace instances of strncpy with strecpy as strncpy doesn't guarantee the resulting string is '\0'-terminated.

This commit is contained in:
rubidium
2008-09-29 16:27:02 +00:00
parent a25d9bcc8b
commit e7829c1a57
10 changed files with 14 additions and 11 deletions

View File

@@ -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) {