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.
This commit is contained in:
Scott Long 2005-01-14 16:24:31 +00:00
parent 74b67e8422
commit 43bc24bf5a
Notes: svn2git 2020-12-20 02:59:44 +00:00
svn path=/head/; revision=140249

View File

@ -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);