[Drbd-dev] [CASE-35] Please check double auto-increment on history_uuids[i++].

Roland Kammerer roland.kammerer at linbit.com
Fri Mar 25 12:02:31 CET 2016


On Fri, Mar 25, 2016 at 07:30:29PM +0900, Jaeheon Kim wrote:
> Hi,
> 
> According to the following code, local i variable be incremented by twice
> in one loop.
> Is this auto-increment operation no problem?
> 
> 
> receive_uuids110()
> {
>     ...
>     for (i = 0; i < history_uuids; i++)
>          peer_device->history_uuids[i++] =
> be64_to_cpu(p->other_uuids[pos++]);
>     ...
> }
> 

Thanks for reporting,

yes, the double increment seems wrong to me.

Regards, rck


More information about the drbd-dev mailing list