===== storage/falcon/SerialLog.cpp 1.105 vs edited ===== --- 1.105/storage/falcon/SerialLog.cpp 2007-07-20 23:39:35 +02:00 +++ edited/storage/falcon/SerialLog.cpp 2007-08-13 14:26:20 +02:00 @@ -203,7 +203,9 @@ void SerialLog::open(JString fileRoot, b int sectorSize = file1->sectorSize; bufferSpace = new UCHAR[windowBuffers * SRL_WINDOW_SIZE + sectorSize]; - UCHAR *space = (UCHAR*) (((IPTR) bufferSpace + sectorSize - 1) / sectorSize * sectorSize); + IPTR round = ABS( (IPTR) bufferSpace % sectorSize); + UCHAR *space = (UCHAR*) bufferSpace + round; + for (int n = 0; n < windowBuffers; ++n, space += SRL_WINDOW_SIZE) buffers.push(space);