summaryrefslogtreecommitdiffstats
path: root/sys
diff options
context:
space:
mode:
authorscottl <scottl@FreeBSD.org>2005-01-14 16:24:31 +0000
committerscottl <scottl@FreeBSD.org>2005-01-14 16:24:31 +0000
commit049337abcfd6fbc4c05f4fbcf3b2b96d8ea0c4e3 (patch)
treefa0333e4c24f7cc82d0517098c14cb052c605721 /sys
parent0c16fd32cca2a79000850e2bf71719145f42ca2f (diff)
downloadFreeBSD-src-049337abcfd6fbc4c05f4fbcf3b2b96d8ea0c4e3.zip
FreeBSD-src-049337abcfd6fbc4c05f4fbcf3b2b96d8ea0c4e3.tar.gz
Replace the min() macro with a test that doesn't truncate the 64-bit values
that are used. Thanks to Bruce Evans for pointing this out.
Diffstat (limited to 'sys')
-rw-r--r--sys/fs/udf/udf_vnops.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/fs/udf/udf_vnops.c b/sys/fs/udf/udf_vnops.c
index 9e9bf97..0fb714c 100644
--- a/sys/fs/udf/udf_vnops.c
+++ b/sys/fs/udf/udf_vnops.c
@@ -416,7 +416,10 @@ udf_read(struct vop_read_args *a)
while (uio->uio_offset < fsize && uio->uio_resid > 0) {
offset = uio->uio_offset;
- size = min(uio->uio_resid, fsize - uio->uio_offset);
+ if (uio->uio_resid + offset <= fsize)
+ size = uio->uio_resid;
+ else
+ size = fsize - offset;
error = udf_readatoffset(node, &size, offset, &bp, &data);
if (error == 0)
error = uiomove(data, size, uio);
OpenPOWER on IntegriCloud