There are several interesting questions raised here regarding undefined behaviour in C. One of them is (slightly modified)
Does the following piece of code r
Undefined behavior in this case would only take place if you modify the same memory address without a sequence point between the modifications. Specifically, the C99 spec, section 6.5/2 states,
Between the previous and next sequence point an object shall have its stored value modified at most once by the evaluation of an expression. Furthermore, the prior value shall be accessed only to determine the value to be stored.
In your case no modification of the same memory address takes place between sequence points, therefore there is no undefined behavior.