[PATCH 3/5] virrandom: Fix printf format string in virRandomGenerateWWN()

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

 



Firstly, drop needless concatenation of two static strings.
Secondly, use proper (portable) formatter for uint64_t so that
typecast to ULL can be dropped.

Signed-off-by: Michal Privoznik <mprivozn@xxxxxxxxxx>
---
 src/util/virrandom.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/src/util/virrandom.c b/src/util/virrandom.c
index 7606dd1684..38fcfbc6ba 100644
--- a/src/util/virrandom.c
+++ b/src/util/virrandom.c
@@ -160,8 +160,7 @@ virRandomGenerateWWN(char **wwn,
         return -1;
     }
 
-    *wwn = g_strdup_printf("5" "%s%09llx", oui,
-                           (unsigned long long)virRandomBits(36));
+    *wwn = g_strdup_printf("5%s%09" PRIx64, oui, virRandomBits(36));
     return 0;
 }
 
-- 
2.41.0




[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