diff options
author | Volker Lendecke <vl@samba.org> | 2010-02-03 07:37:29 +0100 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2010-02-03 12:34:25 -0800 |
commit | e00e6a2c96760b4c64a3a0badefdb582caabd31a (patch) | |
tree | c9b86081f0037e1a1eab67f2b4a3c1a8d50ec8aa | |
parent | e1a1468dd73e1e1edb2cf2d8a09dffebb49e56b6 (diff) | |
download | samba-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.c | 11 |
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; } |