Distributed Replicated Block Device (DRBD) development
 help / color / mirror / Atom feed
* [Drbd-dev] [CASE-35] Please check double auto-increment on history_uuids[i++].
@ 2016-03-25 10:30 Jaeheon Kim
  2016-03-25 11:02 ` Roland Kammerer
  0 siblings, 1 reply; 2+ messages in thread
From: Jaeheon Kim @ 2016-03-25 10:30 UTC (permalink / raw)
  To: drbd-dev

[-- Attachment #1: Type: text/plain, Size: 306 bytes --]

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.

[-- Attachment #2: Type: text/html, Size: 454 bytes --]

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [Drbd-dev] [CASE-35] Please check double auto-increment on history_uuids[i++].
  2016-03-25 10:30 [Drbd-dev] [CASE-35] Please check double auto-increment on history_uuids[i++] Jaeheon Kim
@ 2016-03-25 11:02 ` Roland Kammerer
  0 siblings, 0 replies; 2+ messages in thread
From: Roland Kammerer @ 2016-03-25 11:02 UTC (permalink / raw)
  To: drbd-dev

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2016-03-25 11:02 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-25 10:30 [Drbd-dev] [CASE-35] Please check double auto-increment on history_uuids[i++] Jaeheon Kim
2016-03-25 11:02 ` Roland Kammerer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox