[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[lwip-devel] [bug #18924] index in etharp.c ( function etharp_arp_input
[lwip-devel] [bug #18924] index in etharp.c ( function etharp_arp_input )
Thu, 01 Feb 2007 05:10:28 +0000
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:220.127.116.11) Gecko/20061204 Firefox/18.104.22.168
Follow-up Comment #2, bug #18924 (project lwip):
There is nothing wrong with the original code. i-- as a separate statement
will result in i being decremented before it is first used as an array index.
It is identical to --i in this context. The first iteration of the loop will
therefore access array element 5, and the last iteration will access array
i-- only differs from --i if it is used in a more complex expression where
the value of i is used immediately.
e.g. if i is currently 5 then addr[i--] would access addr and decrement i
to 4, but addr[--i] would decrement i to 4 and access addr.
Reply to this item at:
Message sent via/by Savannah
- [lwip-devel] [bug #18924] index in etharp.c ( function etharp_arp_input ),
David Empson <=