From 4fa96d435fb3a60b4757b41b1d9f273225c79158 Mon Sep 17 00:00:00 2001 From: zhujun2 Date: Mon, 31 Jul 2023 20:08:11 -0700 Subject: [PATCH] virrandom: Fix printf format string in virRandomGenerateWWN() 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 Reviewed-by: Peter Krempa Signed-off-by: zhujun2 (cherry-pick form b857ad0696ca5177eccf482f244665c246b3ace8) --- 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 0487b4e70b..1b4102cf58 100644 --- a/src/util/virrandom.c +++ b/src/util/virrandom.c @@ -158,7 +158,6 @@ 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.27.0