*done_print = 0;
- retries = 16;
+ retries = 0;
do {
rc = kwboot_tty_send(fd, block, sizeof(*block));
if (rc)
if (!allow_non_xm && c != ACK)
kwboot_progress(-1, '+');
- } while (c == NAK && retries-- > 0);
+ } while (c == NAK && retries++ < 16);
if (non_xm_print)
kwboot_printv("\n");
kwboot_printv("Finishing transfer\n");
- retries = 16;
+ retries = 0;
do {
rc = kwboot_tty_send_char(fd, EOT);
if (rc)
rc = kwboot_xm_recv_reply(fd, &c, 0, NULL, 0, NULL);
if (rc)
return rc;
- } while (c == NAK && retries-- > 0);
+ } while (c == NAK && retries++ < 16);
return _xm_reply_to_error(c);
}