mirror of
https://github.com/mariusgreuel/avrdude.git
synced 2025-12-16 10:41:07 +00:00
* fileio.c: ihex2bin did not properly handle files > 64K bytes
* usb_libusb.c: re-enabled usb_reset for Macs (no reset causes lots of failures) * avrdude.1: spacing issue for ucr2 fixed. git-svn-id: svn://svn.savannah.nongnu.org/avrdude/trunk/avrdude@880 81a1dc3b-b13d-400b-aceb-764788c761c2
This commit is contained in:
6
fileio.c
6
fileio.c
@@ -261,7 +261,6 @@ static int ihex_readrec(struct ihexrec * ihex, char * rec)
|
||||
* If an error occurs, return -1.
|
||||
*
|
||||
* */
|
||||
|
||||
static int ihex2b(char * infile, FILE * inf,
|
||||
unsigned char * outbuf, int bufsize)
|
||||
{
|
||||
@@ -279,6 +278,7 @@ static int ihex2b(char * infile, FILE * inf,
|
||||
baseaddr = 0;
|
||||
maxaddr = 0;
|
||||
offsetaddr = 0;
|
||||
nextaddr = 0;
|
||||
|
||||
while (fgets((char *)buffer,MAX_LINE_LEN,inf)!=NULL) {
|
||||
lineno++;
|
||||
@@ -332,7 +332,7 @@ static int ihex2b(char * infile, FILE * inf,
|
||||
|
||||
case 4: /* extended linear address record */
|
||||
baseaddr = (ihex.data[0] << 24 | ihex.data[1]) << 16;
|
||||
if(offsetaddr == 0) offsetaddr = baseaddr;
|
||||
if(nextaddr == 0) offsetaddr = baseaddr; // if provided before any data, then remember it
|
||||
break;
|
||||
|
||||
case 5: /* start linear address record */
|
||||
@@ -358,7 +358,6 @@ static int ihex2b(char * infile, FILE * inf,
|
||||
return maxaddr-offsetaddr;
|
||||
}
|
||||
|
||||
|
||||
static int b2srec(unsigned char * inbuf, int bufsize,
|
||||
int recsize, int startaddr,
|
||||
char * outfile, FILE * outf)
|
||||
@@ -1155,6 +1154,7 @@ int fileio(int op, char * filename, FILEFMT format,
|
||||
if (format != FMT_IMM && !using_stdio) {
|
||||
fclose(f);
|
||||
}
|
||||
|
||||
return rc;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user