summaryrefslogtreecommitdiffstats
path: root/fs/nfs.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs.c')
-rw-r--r--fs/nfs.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/nfs.c b/fs/nfs.c
index 4a880cd302..797e3bd471 100644
--- a/fs/nfs.c
+++ b/fs/nfs.c
@@ -819,7 +819,11 @@ static int nfs_read(struct device_d *dev, FILE *file, void *buf, size_t insize)
insize -= now;
if (insize) {
- now = 1024;
+ /* do not use min as insize is a size_t */
+ if (insize < 1024)
+ now = insize;
+ else
+ now = 1024;
if (pos + now > file->size)
now = file->size - pos;