changeset 625:7ef3343161d6

srec-regions: report the S7 address as well
author Mychaela Falconia <falcon@freecalypso.org>
date Fri, 28 Feb 2020 05:50:47 +0000
parents 7485e75d9477
children d00ffedacab5
files miscutil/srec-regions.c
diffstat 1 files changed, 8 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/miscutil/srec-regions.c	Thu Feb 27 08:12:11 2020 +0000
+++ b/miscutil/srec-regions.c	Fri Feb 28 05:50:47 2020 +0000
@@ -162,9 +162,17 @@
 			region_end = curaddr + datalen;
 			continue;
 		case '7':
+			if (srecbin[0] < 5) {
+				fprintf(stderr,
+					"%s line %d: S7 record is too short\n",
+					infname, lineno);
+				exit(1);
+			}
 			printf("0x%08lX to 0x%08lX (%lu bytes)\n",
 				region_start, region_end,
 				region_end - region_start);
+			printf("S7 address 0x%02X%02X%02X%02X\n", srecbin[1],
+				srecbin[2], srecbin[3], srecbin[4]);
 			exit(0);
 		default:
 			abort();