rem: char * buf;
add: unsigned char * buf; unsigned char b;
context: int cmd_write(int fd, struct avrpart * p, int argc, char * argv[]){  char * e;  int len, maxsize;  char * memtype;  unsigned long addr, i;  char * buf;  int rc;  int werror;  AVRMEM * mem;  if (argc < 4) {    fprintf(stderr, "Usage: write <memtype> <addr> <byte1> "            "<byte2> ... byteN>\n");    return -1;  }  memtype = argv[1];  mem = avr_locate_mem(p, memtype);  if (mem == NULL) {    fprintf(stderr, "\"%s\" memory type not defined for part \"%s\"\n",            memtype, p->desc);    return -1;  }  maxsize = mem->size;  addr = strtoul(argv[2], &e, 0);  if (*e || (e == argv[2])) {    fprintf(stderr, "%s (write): can't parse address \"%s\"\n",            progname, argv[2]);    return -1;  }  if (addr > maxsize) {    fprintf(stderr,             "%s (write): address 0x%05lx is out of range for %s memory\n",            progname, addr, memtype);    return -1;  }  /* number of bytes to write at the specified address */  len = argc - 3;  if ((addr + len) > maxsize) {    fprintf(stderr,             "%s (write): selected address and # bytes exceed "            "range for %s memory\n",             progname, memtype);    return -1;  }  buf = malloc(len);  if (buf == NULL) {    fprintf(stderr, "%s (write): out of memory\n", progname);    return -1;  }  for (i=3; i<argc; i++) {    buf[i-3] = strtoul(argv[i], &e, 0);    if (*e || (e == argv[i])) {      fprintf(stderr, "%s (write): can't parse byte \"%s\"\n",              progname, argv[i]);      free(buf);      return -1;    }  }  LED_OFF(fd, pgm->pinno[PIN_LED_ERR]);  for (werror=0, i=0; i<len; i++) {    rc = avr_write_byte(fd, p, mem, addr+i, buf[i]);    if (rc) {      fprintf(stderr, "%s (write): error writing 0x%02x at 0x%05lx\n",              progname, buf[i], addr+i);      if (rc == -1)        fprintf(stderr,                 "write operation not supported on memory type \"%s\"\n",                mem->desc);      werror = 1;    }    if (werror) {      LED_ON(fd, pgm->pinno[PIN_LED_ERR]);    }  }  free(buf);  fprintf(stdout, "\n");  return 0;}