From ed355d591c6ae7528d01cb2da3fe4e17cc43bcd1 Mon Sep 17 00:00:00 2001 From: Stefan Rueger Date: Sun, 25 Jun 2023 13:58:37 +0100 Subject: [PATCH] Add S5 record count even when it is zero --- src/fileio.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/fileio.c b/src/fileio.c index f94a49fa..cddff602 100644 --- a/src/fileio.c +++ b/src/fileio.c @@ -521,7 +521,7 @@ static int b2srec(const AVRMEM *mem, const Segment_t *segp, Segorder_t where, // Add S5/6 record count record and S7/8/9 end of data record if(where & LAST_SEG) { - if(reccount > 0 && reccount <= 0xffffff) { + if(reccount >= 0 && reccount <= 0xffffff) { int wd = reccount <= 0xffff? 2: 3; fprintf(outf, "S%c%02X%0*X%02X\n", '5' + (wd == 3), wd + 1, 2*wd, reccount, cksum_srec(NULL, 0, reccount, wd));