mirror of
https://gitlab.com/libvirt/libvirt.git
synced 2025-01-22 04:25:18 +00:00
virFileLoopDeviceAssociate: Use virStrcpy instead of virStrncpy
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>
This commit is contained in:
parent
e8f5711274
commit
9595c61625
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user