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 <mprivozn@redhat.com>
Reviewed-by: Peter Krempa <pkrempa@redhat.com>
This commit is contained in:
Michal Privoznik 2023-07-17 15:24:43 +02:00
parent f6e88f6113
commit b857ad0696

View File

@ -154,8 +154,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;
}