diff --git a/lib/tftp.c b/lib/tftp.c
index 20e5fd5da557bececf2e763a2be0222bded6d6ab..1228297e058e9d61d6b3749cff12dec1f6a2c176 100644
--- a/lib/tftp.c
+++ b/lib/tftp.c
@@ -599,11 +599,12 @@ static CURLcode tftp_rx(tftp_state_data_t *state, tftp_event_t event)
       infof(data,
             "Received unexpected DATA packet block %d\n", rblock);
       state->retries++;
-      if(state->retries>state->retry_max) {
+      if(state->retries > state->retry_max) {
         failf(data, "tftp_rx: giving up waiting for block %d",
               NEXT_BLOCKNUM(state->block));
         return CURLE_TFTP_ILLEGAL;
       }
+      break;
     }
     /* This is the expected block.  Reset counters and ACK it. */
     state->block = (unsigned short)rblock;