From 1ecefced86538306d581b05105a93d1268ce0028 Mon Sep 17 00:00:00 2001 From: Anand Jain Date: Mon, 4 Nov 2013 15:17:41 +0800 Subject: btrfs-progs: define BTRFS_UUID_UNPARSE_SIZE for uuid unparse buf size we use 37 as the allocation size to hold the uuid_unparse, here it defines BTRFS_UUID_UNPARSE_SIZE for the same. Signed-off-by: Anand Jain Signed-off-by: David Sterba Signed-off-by: Chris Mason --- print-tree.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) (limited to 'print-tree.c') diff --git a/print-tree.c b/print-tree.c index 76037fe1..c52e5da0 100644 --- a/print-tree.c +++ b/print-tree.c @@ -24,6 +24,7 @@ #include "ctree.h" #include "disk-io.h" #include "print-tree.h" +#include "utils.h" static void print_dir_item_type(struct extent_buffer *eb, @@ -187,21 +188,21 @@ static void print_dev_item(struct extent_buffer *eb, static void print_uuids(struct extent_buffer *eb) { - char fs_uuid[37]; - char chunk_uuid[37]; + char fs_uuid[BTRFS_UUID_UNPARSED_SIZE]; + char chunk_uuid[BTRFS_UUID_UNPARSED_SIZE]; u8 disk_uuid[BTRFS_UUID_SIZE]; read_extent_buffer(eb, disk_uuid, btrfs_header_fsid(), BTRFS_FSID_SIZE); - fs_uuid[36] = '\0'; + fs_uuid[BTRFS_UUID_UNPARSED_SIZE - 1] = '\0'; uuid_unparse(disk_uuid, fs_uuid); read_extent_buffer(eb, disk_uuid, (unsigned long)btrfs_header_chunk_tree_uuid(eb), BTRFS_UUID_SIZE); - chunk_uuid[36] = '\0'; + chunk_uuid[BTRFS_UUID_UNPARSED_SIZE - 1] = '\0'; uuid_unparse(disk_uuid, chunk_uuid); printf("fs uuid %s\nchunk uuid %s\n", fs_uuid, chunk_uuid); } -- cgit v1.2.3