Commit Diff


commit - 11cc08c1dfab6c56e9e4bd98ba204b5a7d56ea9e
commit + 56d815a9328f873fd6818ac625999d06a8752a45
blob - 18f9d880dc8bece0503a96fcd827fbaddd5c5125
blob + f6e9f099eeee7a69e9bd4089987f1a6883cee164
--- lib/worktree.c
+++ lib/worktree.c
@@ -947,6 +947,7 @@ merge_symlink(struct got_worktree *worktree,
 		    ondisk_path);
 		goto done;
 	}
+	ondisk_target[ondisk_len] = '\0';
 
 	if (blob_orig) {
 		err = got_object_blob_read_to_str(&ancestor_target, blob_orig);