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 <chris.mason@fusionio.com>
This commit is contained in:
Chris Mason 2012-07-05 14:58:51 -04:00
parent 2588b4f8be
commit 134adafea2

View File

@ -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) {