summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--lib/fstree/fstree_from_dir.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/fstree/fstree_from_dir.c b/lib/fstree/fstree_from_dir.c
index ff9f078..29911f4 100644
--- a/lib/fstree/fstree_from_dir.c
+++ b/lib/fstree/fstree_from_dir.c
@@ -84,6 +84,8 @@ static int populate_dir(fstree_t *fs, tree_node_t *root)
if (readlink(ent->d_name, extra, sb.st_size) < 0)
goto fail_rdlink;
+
+ extra[sb.st_size] = '\0';
} else if (S_ISREG(sb.st_mode)) {
extra = get_file_path(root, ent->d_name);
if (extra == NULL)