From feeeaca9677414ee7627750559e6b5273142ccb5 Mon Sep 17 00:00:00 2001 From: Karel Zak Date: Wed, 16 Aug 2017 11:55:57 +0200 Subject: libblkid: fix compiler warning [-Wformat-truncation=] The MBR partition pseudo-UUID is generated from table ID and partition partno. The final UUID size limit is 37 bytes. The table ID has to be restricted to keep compiler happy (for MBR the table ID is 8 bytes as string). Signed-off-by: Karel Zak --- libblkid/src/partitions/partitions.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'libblkid') diff --git a/libblkid/src/partitions/partitions.c b/libblkid/src/partitions/partitions.c index 9a11e84aa..626e11729 100644 --- a/libblkid/src/partitions/partitions.c +++ b/libblkid/src/partitions/partitions.c @@ -1368,7 +1368,7 @@ int blkid_partition_gen_uuid(blkid_partition par) if (!par || !par->tab || !*par->tab->id) return -1; - snprintf(par->uuid, sizeof(par->uuid), "%s-%02x", + snprintf(par->uuid, sizeof(par->uuid), "%.33s-%02x", par->tab->id, par->partno); return 0; } -- cgit v1.2.3-55-g7522