Passing 'strlen(src)' for length makes it equivalent to virStrcpy.
Signed-off-by: Peter Krempa <pkrempa@redhat.com>
Reviewed-by: Ján Tomko <jtomko@redhat.com>
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;