Suppress comma at begin of memory segment, not begin of memory

This commit is contained in:
Stefan Rueger
2023-06-11 15:54:53 +01:00
parent 99a25fcd16
commit 20bd7f37bc

View File

@@ -1203,13 +1203,13 @@ static int b2num(const char *filename, FILE *f, const AVRMEM *mem, const Segment
break;
}
for (int i = segp->addr; i < segp->addr + segp->len; i++) {
for(int seen = 0, i = segp->addr; i < segp->addr + segp->len; i++) {
char cbuf[81];
if (i > 0) {
if (putc(',', f) == EOF)
if(seen++)
if(putc(',', f) == EOF)
goto writeerr;
}
unsigned num = mem->buf[i];
/*
* For a base of 8 and a value < 8 to convert, don't write the