From mboxrd@z Thu Jan 1 00:00:00 1970 From: Grant Edwards To: ecos-discuss@sources.redhat.com Subject: [ECOS] Re: RedBoot: load.c srecord input offset fix Date: Thu, 19 Apr 2001 13:37:00 -0000 Message-id: <20010419153901.A29584@visi.com> References: <20010419152033.A29215@visi.com> <20010419152550.A29254@visi.com> X-SW-Source: 2001-04/msg00223.html On Thu, Apr 19, 2001 at 03:25:50PM -0500, Grant Edwards wrote: > > The "offset" variable in load_srec_image() isn't incremented > > properly (assuming its purpose is to keep track of the current > > byte offset in the input stream). My version of load.c has > > diverged enough that I can't generate a usable patch, so I'll > > summarize the changes: Oops, the "discard rest of line" loop at the bottom of the main while loop also needs to be fixed: default: printf("Invalid S-record at offset 0x%lx, type: %x\n", (unsigned long)offset, type); return; } - while ((c = (*getc)()) != '\n') offset++; + do { + c = (*getc)(); + ++offset; + } while (c != '\n'); } } -- Grant Edwards grante@visi.com