summaryrefslogtreecommitdiff
path: root/block/vmdk.c
diff options
context:
space:
mode:
authorFam Zheng <famz@redhat.com>2014-04-17 18:43:53 +0800
committerKevin Wolf <kwolf@redhat.com>2014-04-22 14:14:30 +0200
commit9b17031ac4efcf7a587f0e4eea82287a5329b6e7 (patch)
tree1236e4dbe5f1981f701b64032ab885fe10d9dd6e /block/vmdk.c
parentac1307abfe63ac93a9289e773116bb0de07c335b (diff)
downloadqemu-9b17031ac4efcf7a587f0e4eea82287a5329b6e7.tar.gz
vmdk: Fix "%x" to PRIx32 in format strings for cid
Signed-off-by: Fam Zheng <famz@redhat.com> Signed-off-by: Kevin Wolf <kwolf@redhat.com>
Diffstat (limited to 'block/vmdk.c')
-rw-r--r--block/vmdk.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/block/vmdk.c b/block/vmdk.c
index 938a183e66..06a1f9f93b 100644
--- a/block/vmdk.c
+++ b/block/vmdk.c
@@ -262,7 +262,7 @@ static uint32_t vmdk_read_cid(BlockDriverState *bs, int parent)
p_name = strstr(desc, cid_str);
if (p_name != NULL) {
p_name += cid_str_size;
- sscanf(p_name, "%x", &cid);
+ sscanf(p_name, "%" SCNx32, &cid);
}
return cid;
@@ -290,7 +290,7 @@ static int vmdk_write_cid(BlockDriverState *bs, uint32_t cid)
p_name = strstr(desc, "CID");
if (p_name != NULL) {
p_name += sizeof("CID");
- snprintf(p_name, sizeof(desc) - (p_name - desc), "%x\n", cid);
+ snprintf(p_name, sizeof(desc) - (p_name - desc), "%" PRIx32 "\n", cid);
pstrcat(desc, sizeof(desc), tmp_desc);
}
@@ -1708,8 +1708,8 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options,
const char desc_template[] =
"# Disk DescriptorFile\n"
"version=1\n"
- "CID=%x\n"
- "parentCID=%x\n"
+ "CID=%" PRIx32 "\n"
+ "parentCID=%" PRIx32 "\n"
"createType=\"%s\"\n"
"%s"
"\n"
@@ -1851,7 +1851,7 @@ static int vmdk_create(const char *filename, QEMUOptionParameter *options,
}
/* generate descriptor file */
desc = g_strdup_printf(desc_template,
- (unsigned int)time(NULL),
+ (uint32_t)time(NULL),
parent_cid,
fmt,
parent_desc_line,