diff --git a/src/add-ons/kernel/drivers/arch/x86/floppy/floppy.c b/src/add-ons/kernel/drivers/arch/x86/floppy/floppy.c index 6001ed6c52..2f9d2f9c5d 100644 --- a/src/add-ons/kernel/drivers/arch/x86/floppy/floppy.c +++ b/src/add-ons/kernel/drivers/arch/x86/floppy/floppy.c @@ -414,15 +414,16 @@ flo_read(floppy_cookie *cookie, off_t position, void *data, size_t *numbytes) *numbytes = 0; return err; } - toread = MIN(len, sectsize); + toread = MIN(len, (size_t)sectsize); toread = MIN(toread, sectsize - (position % sectsize)); memcpy(data, cookie->flp->master->buffer + position % cylsize/*(sectsize * ) + (position % sectsize)*/, toread); len -= toread; bytes_read += toread; position += toread; } + // read the middle blocks - while (len >= sectsize) { + while (len >= (size_t)sectsize) { TRACE("read: middle %Ld, %ld, %ld\n", position, bytes_read, len); // try to read as many sectors as we can