differences in while loop compiled with 1.5.2 on Windows and 1.5.7 on Ubuntu

When running a sketch compiled with version 1.5.7 Beta the result of the code below is 2 if decaddr is not found in the byte array. When compiled the same unmodified sketch with version 1.5.2 the result is 3. The latter is the result I expect.

Any hint is welcome, I have no idea what I'm doing wrong in this code fragment?

The global declaration from the top of the sketch:

byte currentSend[3]; // decoder adresses in current cycle

The part of the sketch:

void sendByQueue() {
  byte decaddr = CalculateDecAddr();
  byte hit = 0;
  while ((decaddr != currentSend[hit]) && (hit < 3)) {
    hit++;
  }

When not found at this location hit prints 2 in version 1.5.7 Beta Ubuntu 12, in version 1.5.2 on Windows 7 the unmodified sketch prints 3. Arduino Leonardo

Regards,
Bert

Prints? I don't see any printing.

Post all your code.

http://snippets-r-us.com/