summaryrefslogtreecommitdiff
path: root/source3/smbd/fileio.c
diff options
context:
space:
mode:
Diffstat (limited to 'source3/smbd/fileio.c')
-rw-r--r--source3/smbd/fileio.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/source3/smbd/fileio.c b/source3/smbd/fileio.c
index 5c4bf7dfc2..ebc4544a76 100644
--- a/source3/smbd/fileio.c
+++ b/source3/smbd/fileio.c
@@ -63,7 +63,7 @@ ssize_t read_file(files_struct *fsp,char *data,SMB_OFF_T pos,size_t n)
#if WITH_MMAP
if (fsp->mmap_ptr) {
- SMB_OFF_T num = (fsp->mmap_size > pos) ? (fsp->mmap_size - pos) : -1;
+ SMB_OFF_T num = (fsp->mmap_size > pos) ? (fsp->mmap_size - pos) : 0;
num = MIN(n,num);
if (num > 0) {
memcpy(data,fsp->mmap_ptr+pos,num);