rem: avr_write_byte(fd, AVR_FLASH_LO, i, data ); fprintf ( stderr, "                      \r%4u 0x%02x", i, data );   data = buf[bi++]; avr_write_byte(fd, AVR_FLASH_HI, i, data ); fprintf ( stderr, " 0x%02x", data );
add: rc = avr_write_byte(fd, AVR_FLASH_HI, i, data ); fprintf(stderr, " 0x%02x", data); if (rc) { fprintf(stderr, " ***failed;  " ); nl = 1; }
context: int avr_write ( int fd, int memtype, unsigned start,                 unsigned char * buf, int size ){  unsigned char data;  unsigned short end, i, bi;  switch (memtype) {    case AVR_FLASH  :       end = start+size/2;      break;    case AVR_EEPROM :       end = start+size;      break;    default:      fprintf(stderr, "%s: avr_write(); internal error: invalid memtype=%d\n",              progname, memtype);      exit(1);      break;  }  bi = 0;  for (i=start; i<end; i++) {    if (memtype == AVR_FLASH) {      /* low byte */      data = buf[bi++];      avr_write_byte(fd, AVR_FLASH_LO, i, data );      fprintf ( stderr, "                      \r%4u 0x%02x", i, data );      /* high byte */      data = buf[bi++];      avr_write_byte(fd, AVR_FLASH_HI, i, data );      fprintf ( stderr, " 0x%02x", data );    }    else {      data = buf[bi++];      avr_write_byte(fd, memtype, i, data );      fprintf ( stderr, "            \r%4u 0x%02x", i, data );    }  }  fprintf ( stderr, "\n" );  return 0;}