From 134adafea227e35bdb14fd7563226170a9bfe10c Mon Sep 17 00:00:00 2001 From: Chris Mason Date: Thu, 5 Jul 2012 14:58:51 -0400 Subject: [PATCH] Btrfs: fix off by one in null termination A recent commit was null terminating the root listing strings one byte too short. Signed-off-by: Chris Mason --- btrfs-list.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/btrfs-list.c b/btrfs-list.c index 693d241..c53d016 100644 --- a/btrfs-list.c +++ b/btrfs-list.c @@ -184,7 +184,7 @@ static int add_root(struct root_lookup *root_lookup, ri->ref_tree = ref_tree; strncpy(ri->name, name, name_len); if (name_len > 0) - ri->name[name_len-1] = 0; + ri->name[name_len] = 0; ret = tree_insert(&root_lookup->root, root_id, ref_tree, &ri->rb_node); if (ret) { -- 2.7.4