Fix off-by-one in uidset handling for fetches
authorDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 21 May 2012 15:42:26 +0000 (16:42 +0100)
committerDavid Woodhouse <David.Woodhouse@intel.com>
Mon, 21 May 2012 15:42:26 +0000 (16:42 +0100)
commit7dd91af4568d1247e32e33319a875c274d6c7ca5
tree0528214df63e3d8e8fdd9b257a85dfee9ad8051b
parente689ff03dfa4d23722d14bdfd93103a91e4cd7e5
Fix off-by-one in uidset handling for fetches

When we get to the end of the for() loop processing the uidset, the index
variable is one *more* than the last item. That's how for() loops in C
work.

But when we break out of the middle because we are limiting the batch
size, we were forgetting to do the same and we were storing the index
of the last item that we'd already fetched.

This was causing us to re-fetch the last message of one batch, as the
first message of the next batch. Mostly harmless, but spotted and fixed
as part of bug 667725.
camel/camel-imapx-server.c