fs/nfs: fix compile warning

Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
chao.an 2022-03-18 23:47:00 +08:00 committed by Xiang Xiao
parent 38b3da6d00
commit 9de2818c18
2 changed files with 7 additions and 5 deletions

View File

@ -903,7 +903,7 @@ static ssize_t nfs_read(FAR struct file *filep, FAR char *buffer,
if (buflen > tmp)
{
buflen = tmp;
finfo("Read size truncated to %d\n", buflen);
finfo("Read size truncated to %zu\n", buflen);
}
/* Now loop until we fill the user buffer (or hit the end of the file) */
@ -957,7 +957,7 @@ static ssize_t nfs_read(FAR struct file *filep, FAR char *buffer,
/* Perform the read */
finfo("Reading %d bytes\n", readsize);
finfo("Reading %zu bytes\n", readsize);
nfs_statistics(NFSPROC_READ);
ret = nfs_request(nmp, NFSPROC_READ,
(FAR void *)&nmp->nm_msgbuffer.read, reqlen,
@ -2006,7 +2006,7 @@ static int nfs_bind(FAR struct inode *blkdriver, FAR const void *data,
nmp->nm_rsize = nprmt.rsize;
nmp->nm_readdirsize = nprmt.readdirsize;
strncpy(nmp->nm_path, argp->path, 90);
strlcpy(nmp->nm_path, argp->path, sizeof(nmp->nm_path));
memcpy(&nmp->nm_nam, &argp->addr, argp->addrlen);
/* Create an instance of the rpc state structure */

View File

@ -588,7 +588,8 @@ int rpcclnt_connect(FAR struct rpcclnt *rpc)
/* Do RPC to mountd. */
strncpy(request.mountd.mount.rpath, rpc->rc_path, 90);
strlcpy(request.mountd.mount.rpath, rpc->rc_path,
sizeof(request.mountd.mount.rpath));
request.mountd.mount.len =
txdr_unsigned(sizeof(request.mountd.mount.rpath));
@ -716,7 +717,8 @@ void rpcclnt_disconnect(FAR struct rpcclnt *rpc)
/* Do RPC to umountd. */
strncpy(request.mountd.umount.rpath, rpc->rc_path, 90);
strlcpy(request.mountd.umount.rpath, rpc->rc_path,
sizeof(request.mountd.umount.rpath));
request.mountd.umount.len =
txdr_unsigned(sizeof(request.mountd.umount.rpath));