From 70dcec7df776ea10ded24bdbd76d5ebb160918b7 Mon Sep 17 00:00:00 2001 From: Gregory Nutt Date: Fri, 3 Feb 2017 14:12:24 -0600 Subject: [PATCH] readlink: Fix bugs from initial testing --- fs/vfs/fs_readlink.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/fs/vfs/fs_readlink.c b/fs/vfs/fs_readlink.c index b5a38f1cc63..d847f485302 100644 --- a/fs/vfs/fs_readlink.c +++ b/fs/vfs/fs_readlink.c @@ -91,7 +91,7 @@ ssize_t readlink(FAR const char *path, FAR char *buf, size_t bufsize) * symbolic link node. */ - node = inode_find(path, &relpath); + node = inode_find_nofollow(path, &relpath); if (node == NULL) { errcode = ENOENT; @@ -113,7 +113,7 @@ ssize_t readlink(FAR const char *path, FAR char *buf, size_t bufsize) /* Copy the link target pathto the user-provided buffer. */ *buf = '\0'; - (void)strncpy(node->u.i_link, buf, bufsize); + (void)strncpy(buf, node->u.i_link, bufsize); /* Release our reference on the inode and return the length */