diff options
author | Guy Harris <guy@alum.mit.edu> | 2018-10-16 00:15:38 -0700 |
---|---|---|
committer | Guy Harris <guy@alum.mit.edu> | 2018-10-16 00:15:38 -0700 |
commit | 017c240336a375aebd52ec30cf341a207f1c12a4 (patch) | |
tree | 51018597dbbf7efcfeb940e14f0a7bd58ea01095 /sockutils.c | |
parent | ed63d72f6b9bddab83fc35a957a6a9ff02501d0a (diff) |
Provide out own strlcpy() and strlcat() routines if necessary.
We now depend on the *full* semantics of those routines, including the
return value being usable for truncation checks.
If we're building for a UN*X that has them, define pcap_strl{cpy,cat} to
be strl{cpy,cat}.
If we're building for Windows using MSVC, define pcap_strl{cpy,cat}, not
strl{cpy,cat}.
Otherwise, build our won versions of pcap_strl{cpy,cat} from BSD-derived
source code.
Diffstat (limited to 'sockutils.c')
-rw-r--r-- | sockutils.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sockutils.c b/sockutils.c index d2ceaaba..4bb97a71 100644 --- a/sockutils.c +++ b/sockutils.c @@ -1385,7 +1385,7 @@ int sock_getascii_addrport(const struct sockaddr_storage *sockaddr, char *addres (memcmp(&((struct sockaddr_in6 *) sockaddr)->sin6_addr, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0", sizeof(struct in6_addr)) == 0)) { if (address) - strlcpy(address, SOCKET_NAME_NULL_DAD, addrlen); + pcap_strlcpy(address, SOCKET_NAME_NULL_DAD, addrlen); return retval; } } @@ -1401,13 +1401,13 @@ int sock_getascii_addrport(const struct sockaddr_storage *sockaddr, char *addres if (address) { - strlcpy(address, SOCKET_NO_NAME_AVAILABLE, addrlen); + pcap_strlcpy(address, SOCKET_NO_NAME_AVAILABLE, addrlen); address[addrlen - 1] = 0; } if (port) { - strlcpy(port, SOCKET_NO_PORT_AVAILABLE, portlen); + pcap_strlcpy(port, SOCKET_NO_PORT_AVAILABLE, portlen); port[portlen - 1] = 0; } |