diff --git a/fileio.c b/fileio.c index f3806215..19591747 100644 --- a/fileio.c +++ b/fileio.c @@ -360,11 +360,10 @@ int b2srec(unsigned char * inbuf, int bufsize, char * outfile, FILE * outf) { unsigned char * buf; - unsigned int nextaddr, stopaddr; + unsigned int nextaddr; int n, nbytes, addr_width; int i; unsigned char cksum; - unsigned char startf, stopf ,emptyf; char * tmpl=0; @@ -373,39 +372,11 @@ int b2srec(unsigned char * inbuf, int bufsize, progname, recsize); return -1; } - + + nextaddr = startaddr; buf = inbuf; - nextaddr = 0; - stopaddr = 0; - startf = 0; - stopf = 0; + nbytes = 0; - /* search for ranges of 'real' data */ - for (i=startaddr; i0; i--) + cksum += (nextaddr >> (i-1) * 8) & 0xff; + for (i=nextaddr; i0; i--) - cksum += (nextaddr >> (i-1) * 8) & 0xff; - - for (i=nextaddr; i