mirror of
https://github.com/X11Libre/xserver.git
synced 2026-10-09 23:22:22 +00:00
Convert strncpy/strncat to strlcpy/strlcat
As long as we're carrying around a compatibility copy in os/strl*.c, might as well use them. Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com> Reviewed-by: Jeremy Huddleston <jeremyhu@apple.com>
This commit is contained in:
parent
e189dbb3e5
commit
6e6d732bac
13 changed files with 21 additions and 33 deletions
|
|
@ -1756,8 +1756,7 @@ siHostnameAddrMatch(int family, pointer addr, int len,
|
|||
if (siAddrLen >= sizeof(hostname))
|
||||
return FALSE;
|
||||
|
||||
strncpy(hostname, siAddr, siAddrLen);
|
||||
hostname[siAddrLen] = '\0';
|
||||
strlcpy(hostname, siAddr, siAddrLen + 1);
|
||||
|
||||
if (getaddrinfo(hostname, NULL, NULL, &addresses) == 0) {
|
||||
for (a = addresses ; a != NULL ; a = a->ai_next) {
|
||||
|
|
@ -1786,8 +1785,7 @@ siHostnameAddrMatch(int family, pointer addr, int len,
|
|||
if (siAddrLen >= sizeof(hostname))
|
||||
return FALSE;
|
||||
|
||||
strncpy(hostname, siAddr, siAddrLen);
|
||||
hostname[siAddrLen] = '\0';
|
||||
strlcpy(hostname, siAddr, siAddrLen + 1);
|
||||
|
||||
if ((hp = _XGethostbyname(hostname, hparams)) != NULL) {
|
||||
#ifdef h_addr /* new 4.3bsd version of gethostent */
|
||||
|
|
|
|||
Loading…
Reference in a new issue