summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorVolker Lendecke <vl@samba.org>2010-02-03 07:37:29 +0100
committerJeremy Allison <jra@samba.org>2010-02-03 12:34:25 -0800
commite00e6a2c96760b4c64a3a0badefdb582caabd31a (patch)
treec9b86081f0037e1a1eab67f2b4a3c1a8d50ec8aa
parente1a1468dd73e1e1edb2cf2d8a09dffebb49e56b6 (diff)
downloadsamba-e00e6a2c96760b4c64a3a0badefdb582caabd31a.tar.gz
samba-e00e6a2c96760b4c64a3a0badefdb582caabd31a.tar.bz2
samba-e00e6a2c96760b4c64a3a0badefdb582caabd31a.zip
s3: Simplify the code a bit: Catch (len==0) early
-rw-r--r--source3/modules/vfs_expand_msdfs.c11
1 files changed, 4 insertions, 7 deletions
diff --git a/source3/modules/vfs_expand_msdfs.c b/source3/modules/vfs_expand_msdfs.c
index 177ebdb928..0772215a28 100644
--- a/source3/modules/vfs_expand_msdfs.c
+++ b/source3/modules/vfs_expand_msdfs.c
@@ -187,7 +187,7 @@ static int expand_msdfs_readlink(struct vfs_handle_struct *handle,
result = SMB_VFS_NEXT_READLINK(handle, path, target,
PATH_MAX);
- if (result < 0)
+ if (result <= 0)
return result;
target[result] = '\0';
@@ -202,12 +202,9 @@ static int expand_msdfs_readlink(struct vfs_handle_struct *handle,
}
len = MIN(bufsiz, strlen(target));
- if (len) {
- memcpy(buf, target, len);
- } else {
- errno = ENOENT;
- return -1;
- }
+
+ memcpy(buf, target, len);
+
TALLOC_FREE(target);
return len;
}