diff options
author | Karel Zak | 2017-08-16 11:55:57 +0200 |
---|---|---|
committer | Karel Zak | 2017-08-16 11:55:57 +0200 |
commit | feeeaca9677414ee7627750559e6b5273142ccb5 (patch) | |
tree | dd7f44462497c6c0cb3e04d1a2e466e0f00bc438 /libblkid | |
parent | cfdisk: add missing 0x7F key mapping (diff) | |
download | kernel-qcow2-util-linux-feeeaca9677414ee7627750559e6b5273142ccb5.tar.gz kernel-qcow2-util-linux-feeeaca9677414ee7627750559e6b5273142ccb5.tar.xz kernel-qcow2-util-linux-feeeaca9677414ee7627750559e6b5273142ccb5.zip |
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 <kzak@redhat.com>
Diffstat (limited to 'libblkid')
-rw-r--r-- | libblkid/src/partitions/partitions.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; } |