diff --git a/lib/libshare/nfs.c b/lib/libshare/nfs.c index 118ad7ef2..3962c8745 100644 --- a/lib/libshare/nfs.c +++ b/lib/libshare/nfs.c @@ -97,7 +97,7 @@ nfs_init_tmpfile(const char *prefix, const char *mdir, struct tmpfile *tmpf) } strlcpy(tmpf->name, prefix, sizeof (tmpf->name)); - strlcat(tmpf->name, ".XXXXXXXX", sizeof (tmpf->name) - strlen(prefix)); + strlcat(tmpf->name, ".XXXXXXXX", sizeof (tmpf->name)); int fd = mkostemp(tmpf->name, O_CLOEXEC); if (fd == -1) { diff --git a/lib/libzfs/libzfs_sendrecv.c b/lib/libzfs/libzfs_sendrecv.c index 1d2ad1944..66a22e333 100644 --- a/lib/libzfs/libzfs_sendrecv.c +++ b/lib/libzfs/libzfs_sendrecv.c @@ -4590,7 +4590,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, B_FALSE, destsnap) == 0) { *strchr(destsnap, '@') = '\0'; (void) strlcat(destsnap, suffix, - sizeof (destsnap) - strlen(destsnap)); + sizeof (destsnap)); } } } else { @@ -4626,7 +4626,7 @@ zfs_receive_one(libzfs_handle_t *hdl, int infd, const char *tosnap, B_FALSE, destsnap) == 0) { *strchr(destsnap, '@') = '\0'; (void) strlcat(destsnap, snap, - sizeof (destsnap) - strlen(destsnap)); + sizeof (destsnap)); } } } diff --git a/module/zfs/dmu_send.c b/module/zfs/dmu_send.c index 33beb04b1..f86a0a5b1 100644 --- a/module/zfs/dmu_send.c +++ b/module/zfs/dmu_send.c @@ -3029,8 +3029,7 @@ dmu_send_estimate_fast(dsl_dataset_t *origds, dsl_dataset_t *fromds, dsl_dataset_name(origds, dsname); (void) strcat(dsname, "/"); - (void) strlcat(dsname, recv_clone_name, - sizeof (dsname) - strlen(dsname)); + (void) strlcat(dsname, recv_clone_name, sizeof (dsname)); err = dsl_dataset_hold(origds->ds_dir->dd_pool, dsname, FTAG, &ds);