[PATCH 05/16] virFileLoopDeviceAssociate: Use virStrcpy instead of virStrncpy

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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




[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux