blobfs: Remove all uses of strncpy

strncpy is going to be added to the list of banned functions because
it does not guarantee strings are null terminated.

Change-Id: I14e2ce65401bbdb77260627e94aa936797c20ce0
Signed-off-by: Ben Walker <benjamin.walker@intel.com>
Reviewed-on: https://review.gerrithub.io/407020
Tested-by: SPDK Automated Test System <sys_sgsw@intel.com>
Reviewed-by: Dariusz Stojaczyk <dariuszx.stojaczyk@intel.com>
Reviewed-by: Changpeng Liu <changpeng.liu@intel.com>
Reviewed-by: Jim Harris <james.r.harris@intel.com>
This commit is contained in:
Ben Walker 2018-04-09 16:06:25 -07:00 committed by Daniel Verkamp
parent 7b822323e8
commit 38d75b56f4

View File

@ -496,7 +496,7 @@ spdk_fs_init(struct spdk_bs_dev *dev, struct spdk_blobfs_opts *opt,
args->fs = fs;
spdk_bs_opts_init(&opts);
strncpy(opts.bstype.bstype, "BLOBFS", SPDK_BLOBSTORE_TYPE_LENGTH);
snprintf(opts.bstype.bstype, sizeof(opts.bstype.bstype), "BLOBFS");
if (opt) {
opts.cluster_sz = opt->cluster_sz;
}