X-Git-Url: https://git.ucc.asn.au/?a=blobdiff_plain;f=Kernel%2Fdrvutil.c;h=7e5b9b185f8e2483be1c509f3414c00fe7c05840;hb=9d85201216cb35e1b1e051b1d7cdc38eaa5befa4;hp=85d4434d3cb48a1af7bc6f8f5193b8707c9b6d9f;hpb=635bc78017d8a4a16314a973e39c849b2afac795;p=tpg%2Facess2.git diff --git a/Kernel/drvutil.c b/Kernel/drvutil.c index 85d4434d..7e5b9b18 100644 --- a/Kernel/drvutil.c +++ b/Kernel/drvutil.c @@ -118,7 +118,7 @@ Uint64 DrvUtil_ReadBlock(Uint64 Start, Uint64 Length, void *Buffer, return leading; } - Buffer += leading; + Buffer = (Uint8*)Buffer + leading; block ++; num = ( Length - leading ) / BlockSize; tailings = Length - num * BlockSize - leading; @@ -144,7 +144,7 @@ Uint64 DrvUtil_ReadBlock(Uint64 Start, Uint64 Length, void *Buffer, { LOG("Reading %i bytes from last block", tailings); block += num; - Buffer += num * BlockSize; + Buffer = (Uint8*)Buffer + num * BlockSize; ret = ReadBlocks(block, 1, tmp, Argument); if(ret != 1) { LEAVE('X', leading + num * BlockSize); @@ -197,7 +197,7 @@ Uint64 DrvUtil_WriteBlock(Uint64 Start, Uint64 Length, void *Buffer, return leading; } - Buffer += leading; + Buffer = (Uint8*)Buffer + leading; block ++; num = ( Length - leading ) / BlockSize; tailings = Length - num * BlockSize - leading; @@ -223,7 +223,7 @@ Uint64 DrvUtil_WriteBlock(Uint64 Start, Uint64 Length, void *Buffer, { LOG("Writing %i bytes to last block", tailings); block += num; - Buffer += num * BlockSize; + Buffer = (Uint8*)Buffer + num * BlockSize; // Read ret = ReadBlocks(block, 1, tmp, Argument); if(ret != 1) {