/*
- * Copyright (C) 1996-2020 The Squid Software Foundation and contributors
+ * Copyright (C) 1996-2021 The Squid Software Foundation and contributors
*
* Squid software is distributed under GPLv2+ license and includes
* contributions from numerous individuals and organizations.
* Update/Maintenance History:
*
* 16-Aug-2007 : Copied from fetchmail 6.3.8
- * - added protection around libray headers
+ * - added protection around library headers
* - added use of alternative name xgetnameinfo
* to split from any OS-provided.
*
if (sp) {
if (strlen(sp->s_name) + 1 > servlen)
return EAI_OVERFLOW;
- strncpy(serv, sp->s_name, servlen);
+ xstrncpy(serv, sp->s_name, servlen);
} else {
snprintf(numserv, sizeof(numserv), "%u", ntohs(port));
if (strlen(numserv) + 1 > servlen)
return EAI_OVERFLOW;
- strncpy(serv, numserv, servlen);
+ xstrncpy(serv, numserv, servlen);
}
}
#endif
return EAI_OVERFLOW;
}
- strncpy(host, hp->h_name, hostlen);
+ xstrncpy(host, hp->h_name, hostlen);
#if USE_GETIPNODEBY
freehostent(hp);
#endif
numaddrlen = strlen(numaddr);
if (numaddrlen + 1 > hostlen) /* don't forget terminator */
return EAI_OVERFLOW;
- strncpy(host, numaddr, hostlen);
+ xstrncpy(host, numaddr, hostlen);
if (((const struct sockaddr_in6 *)sa)->sin6_scope_id) {
char zonebuf[SQUIDHOSTNAMELEN];