rem: fprintf(stderr, "                      \r%4lu 0x%02x", i, data);
add: if (i % 1024 == 0) fprintf(stderr, "                      \r%4lu 0x%02x", i, data);
context: int avr_write(int fd, AVRPART * p, int memtype, int size){  int              rc;  int              wsize;  unsigned long    i;  unsigned char    data;  int              werror;  LED_OFF(fd, pgm->pinno[PIN_LED_ERR]);  werror = 0;  wsize = p->mem[memtype].size;  if (size < wsize) {    wsize = size;  }  else if (size > wsize) {    fprintf(stderr,             "%s: WARNING: %d bytes requested, but memory region is only %d bytes\n"            "%sOnly %d bytes will actually be written\n",            progname, size, wsize,            progbuf, wsize);  }  for (i=0; i<wsize; i++) {    /* eeprom or low byte of flash */    data = p->mem[memtype].buf[i];    rc = avr_write_byte(fd, p, memtype, i, data);    fprintf(stderr, "                      \r%4lu 0x%02x", i, data);    if (rc) {      fprintf(stderr, " ***failed;  ");      fprintf(stderr, "\n");      LED_ON(fd, pgm->pinno[PIN_LED_ERR]);      werror = 1;    }    if (p->mem[memtype].banked) {      if (((i % p->mem[memtype].bank_size) == p->mem[memtype].bank_size-1) ||          (i == wsize-1)) {        rc = avr_write_bank(fd, p, memtype, i/p->mem[memtype].bank_size);        if (rc) {          fprintf(stderr,                  " *** bank %ld (addresses 0x%04lx - 0x%04lx) failed to write\n",                  i % p->mem[memtype].bank_size,                   i-p->mem[memtype].bank_size+1, i);          fprintf(stderr, "\n");          LED_ON(fd, pgm->pinno[PIN_LED_ERR]);          werror = 1;        }      }    }    if (werror) {      /*        * make sure the error led stay on if there was a previous write       * error, otherwise it gets cleared in avr_write_byte()        */      LED_ON(fd, pgm->pinno[PIN_LED_ERR]);    }  }  fprintf(stderr, "\n");  return i;}