(Partially) submitted by John Voltz:
bug #20004: AVRDUDE update (-U) operations do not close files * fileio.c (fmt_autodetect, fileio): fclose() files. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@801 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
parent
0c29ebc694
commit
1a3155dd75
|
@ -1,3 +1,9 @@
|
||||||
|
2009-02-19 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||||
|
|
||||||
|
(Partially) submitted by John Voltz:
|
||||||
|
bug #20004: AVRDUDE update (-U) operations do not close files
|
||||||
|
* fileio.c (fmt_autodetect, fileio): fclose() files.
|
||||||
|
|
||||||
2009-02-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
2009-02-18 Joerg Wunsch <j.gnu@uriah.heep.sax.de>
|
||||||
|
|
||||||
* usbtiny.c: Replace all but one (very unlikely to trigger) exit(1)
|
* usbtiny.c: Replace all but one (very unlikely to trigger) exit(1)
|
||||||
|
|
17
fileio.c
17
fileio.c
|
@ -969,8 +969,10 @@ static int fmt_autodetect(char * fname)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (found)
|
if (found) {
|
||||||
|
fclose(f);
|
||||||
return FMT_RBIN;
|
return FMT_RBIN;
|
||||||
|
}
|
||||||
|
|
||||||
/* check for lines that look like intel hex */
|
/* check for lines that look like intel hex */
|
||||||
if ((buf[0] == ':') && (len >= 11)) {
|
if ((buf[0] == ':') && (len >= 11)) {
|
||||||
|
@ -981,9 +983,11 @@ static int fmt_autodetect(char * fname)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (found)
|
if (found) {
|
||||||
|
fclose(f);
|
||||||
return FMT_IHEX;
|
return FMT_IHEX;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/* check for lines that look like motorola s-record */
|
/* check for lines that look like motorola s-record */
|
||||||
if ((buf[0] == 'S') && (len >= 10) && isdigit(buf[1])) {
|
if ((buf[0] == 'S') && (len >= 10) && isdigit(buf[1])) {
|
||||||
|
@ -994,11 +998,14 @@ static int fmt_autodetect(char * fname)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (found)
|
if (found) {
|
||||||
|
fclose(f);
|
||||||
return FMT_SREC;
|
return FMT_SREC;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
fclose(f);
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1143,7 +1150,9 @@ int fileio(int op, char * filename, FILEFMT format,
|
||||||
rc = avr_mem_hiaddr(mem);
|
rc = avr_mem_hiaddr(mem);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
if (format != FMT_IMM) {
|
||||||
|
fclose(f);
|
||||||
|
}
|
||||||
return rc;
|
return rc;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue