aboutsummaryrefslogtreecommitdiffstats
path: root/btrfs-debug-tree.c
diff options
context:
space:
mode:
authorAnand Jain <anand.jain@oracle.com>2013-11-04 15:17:41 +0800
committerChris Mason <clm@fb.com>2014-01-31 08:22:03 -0800
commit1ecefced86538306d581b05105a93d1268ce0028 (patch)
tree2c056cfa051e67a6773add9f2b5b550470f1fdcd /btrfs-debug-tree.c
parent457b1286dd9976efbfec25bb286ddc8cec410aa1 (diff)
downloadbtrfs-progs-1ecefced86538306d581b05105a93d1268ce0028.tar.gz
btrfs-progs-1ecefced86538306d581b05105a93d1268ce0028.tar.xz
btrfs-progs-1ecefced86538306d581b05105a93d1268ce0028.zip
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 <anand.jain@oracle.com> Signed-off-by: David Sterba <dsterba@suse.cz> Signed-off-by: Chris Mason <clm@fb.com>
Diffstat (limited to 'btrfs-debug-tree.c')
-rw-r--r--btrfs-debug-tree.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/btrfs-debug-tree.c b/btrfs-debug-tree.c
index 4a83770..f37de9d 100644
--- a/btrfs-debug-tree.c
+++ b/btrfs-debug-tree.c
@@ -27,6 +27,7 @@
#include "print-tree.h"
#include "transaction.h"
#include "version.h"
+#include "utils.h"
static int print_usage(void)
{
@@ -125,7 +126,7 @@ int main(int ac, char **av)
struct extent_buffer *leaf;
struct btrfs_disk_key disk_key;
struct btrfs_key found_key;
- char uuidbuf[37];
+ char uuidbuf[BTRFS_UUID_UNPARSED_SIZE];
int ret;
int slot;
int extent_only = 0;
@@ -392,7 +393,7 @@ no_node:
(unsigned long long)btrfs_super_total_bytes(info->super_copy));
printf("bytes used %llu\n",
(unsigned long long)btrfs_super_bytes_used(info->super_copy));
- uuidbuf[36] = '\0';
+ uuidbuf[BTRFS_UUID_UNPARSED_SIZE - 1] = '\0';
uuid_unparse(info->super_copy->fsid, uuidbuf);
printf("uuid %s\n", uuidbuf);
printf("%s\n", BTRFS_BUILD_VERSION);