1
0
mirror of https://git.FreeBSD.org/src.git synced 2024-12-13 10:02:38 +00:00

Replace the conventional usage of strncpy() by using strlcpy().

This commit is contained in:
Robert Drehmel 2002-10-17 22:27:21 +00:00
parent 75e8f2dad8
commit f9067a4978
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=105360
2 changed files with 5 additions and 13 deletions

View File

@ -122,7 +122,7 @@ svr4_sock_ioctl(fp, td, retval, fd, cmd, data)
if ((error = copyin(data, &sr, sizeof(sr))) != 0)
return error;
(void) strncpy(br.ifr_name, sr.svr4_ifr_name,
(void) strlcpy(br.ifr_name, sr.svr4_ifr_name,
sizeof(br.ifr_name));
if ((error = fo_ioctl(fp, SIOCGIFFLAGS,
(caddr_t) &br, td->td_ucred,

View File

@ -477,19 +477,11 @@ svr4_sys_uname(td, uap)
memset(&sut, 0, sizeof(sut));
strncpy(sut.sysname, ostype, sizeof(sut.sysname));
sut.sysname[sizeof(sut.sysname) - 1] = '\0';
strlcpy(sut.sysname, ostype, sizeof(sut.sysname));
getcredhostname(td->td_ucred, sut.nodename, sizeof(sut.nodename));
strncpy(sut.release, osrelease, sizeof(sut.release));
sut.release[sizeof(sut.release) - 1] = '\0';
strncpy(sut.version, version, sizeof(sut.version));
sut.version[sizeof(sut.version) - 1] = '\0';
strncpy(sut.machine, machine, sizeof(sut.machine));
sut.machine[sizeof(sut.machine) - 1] = '\0';
strlcpy(sut.release, osrelease, sizeof(sut.release));
strlcpy(sut.version, version, sizeof(sut.version));
strlcpy(sut.machine, machine, sizeof(sut.machine));
return copyout((caddr_t) &sut, (caddr_t) SCARG(uap, name),
sizeof(struct svr4_utsname));