diff options
Diffstat (limited to 'base/chunk_generator.hh')
-rw-r--r-- | base/chunk_generator.hh | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/base/chunk_generator.hh b/base/chunk_generator.hh index 83caaca88..afd577814 100644 --- a/base/chunk_generator.hh +++ b/base/chunk_generator.hh @@ -82,11 +82,18 @@ class ChunkGenerator // set up initial chunk. curAddr = startAddr; - // nextAddr should be *next* chunk start - nextAddr = roundUp(startAddr, chunkSize); - if (curAddr == nextAddr) { - // ... even if startAddr is already chunk-aligned - nextAddr += chunkSize; + if (chunkSize == 0) //Special Case, if we see 0, assume no chuncking + { + nextAddr = startAddr + totalSize; + } + else + { + // nextAddr should be *next* chunk start + nextAddr = roundUp(startAddr, chunkSize); + if (curAddr == nextAddr) { + // ... even if startAddr is already chunk-aligned + nextAddr += chunkSize; + } } // how many bytes are left between curAddr and the end of this chunk? |