Fix off-by-one bug.

Submitted by:	chi@bd.mbn.or.jp (Chiharu Shibata)
This commit is contained in:
Yoshihiro Takahashi 2003-05-03 01:47:38 +00:00
parent 5b27e93419
commit 0e7902c6cd

View File

@ -629,7 +629,7 @@ snc_nec16_copyfrombuf(sc, dst, offset, size)
if (size > 3) {
if (noffset & 3) {
size_t asize = (~noffset & 3);
size_t asize = 4 - (noffset & 3);
bus_space_read_region_1(memt, memh, noffset,
bptr, asize);
@ -670,7 +670,7 @@ snc_nec16_copytobuf(sc, src, offset, size)
if (size > 3) {
if (noffset & 3) {
size_t asize = (~noffset & 3);
size_t asize = 4 - (noffset & 3);
bus_space_write_region_1(memt, memh, noffset,
bptr, asize);
@ -712,7 +712,7 @@ snc_nec16_zerobuf(sc, offset, size)
if (size > 3) {
if (noffset & 3) {
size_t asize = (~noffset & 3);
size_t asize = 4 - (noffset & 3);
bus_space_set_region_1(memt, memh, noffset, 0, asize);
noffset += asize;