wimfs_readlink(): Return -EINVAL if buf_len == 0, not -ENAMETOOLONG
authorEric Biggers <ebiggers3@gmail.com>
Sun, 12 Jan 2014 06:37:08 +0000 (00:37 -0600)
committerEric Biggers <ebiggers3@gmail.com>
Sun, 12 Jan 2014 06:37:08 +0000 (00:37 -0600)
src/mount_image.c

index d8a9429..1a8443e 100644 (file)
@@ -2031,7 +2031,7 @@ wimfs_readlink(const char *path, char *buf, size_t buf_len)
        if (!inode_is_symlink(inode))
                return -EINVAL;
        if (buf_len == 0)
-               return -ENAMETOOLONG;
+               return -EINVAL;
        ret = wim_inode_readlink(inode, buf, buf_len - 1, NULL);
        if (ret >= 0) {
                wimlib_assert(ret <= buf_len - 1);