Cast block number to off_t to avoid possible overflow bugs.

Pointed out by: Bruce Evans <bde@zeta.org.au>
This commit is contained in:
jwd 2000-10-24 03:28:59 +00:00
parent a800a462ef
commit 869ef8b48c

View File

@ -1380,7 +1380,7 @@ wtfs(bno, size, bf)
return;
done = 1;
}
if (wc_sect * sectorsize + wc_end == bno * sectorsize &&
if ((off_t)wc_sect * sectorsize + wc_end == (off_t)bno * sectorsize &&
wc_end + size <= WCSIZE) {
bcopy(bf, wc + wc_end, size);
wc_end += size;