Passing 'strlen(src)' for length makes it equivalent to virStrcpy. Signed-off-by: Peter Krempa <pkrempa@xxxxxxxxxx> --- src/util/virfile.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/util/virfile.c b/src/util/virfile.c index 841a0f4e00..29445fc0ff 100644 --- a/src/util/virfile.c +++ b/src/util/virfile.c @@ -810,8 +810,7 @@ int virFileLoopDeviceAssociate(const char *file, lo.lo_flags = LO_FLAGS_AUTOCLEAR; /* Set backing file name for LOOP_GET_STATUS64 queries */ - if (virStrncpy((char *) lo.lo_file_name, file, - strlen(file), LO_NAME_SIZE) < 0) { + if (virStrcpy((char *) lo.lo_file_name, file, LO_NAME_SIZE) < 0) { virReportSystemError(errno, _("Unable to set backing file %s"), file); goto cleanup; -- 2.29.2