diff --git a/lib/libutil/quotafile.c b/lib/libutil/quotafile.c index 6b5a44d9cdf7..27444c2e31a5 100644 --- a/lib/libutil/quotafile.c +++ b/lib/libutil/quotafile.c @@ -124,7 +124,7 @@ quota_open(struct fstab *fs, int quotatype, int openflags) return (NULL); qf->fd = -1; qf->quotatype = quotatype; - strncpy(qf->fsname, fs->fs_file, sizeof(qf->fsname)); + strlcpy(qf->fsname, fs->fs_file, sizeof(qf->fsname)); if (stat(qf->fsname, &st) != 0) goto error; qf->dev = st.st_dev;