changeset 43:eee03b6ac615

loadagent: buglet in the ML command was breaking fc-xram; fixed
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Mon, 17 Jun 2013 07:28:51 +0000
parents 5da0cbee2b89
children 5ca0ad4003a0
files target-utils/libload/cmd_memload.c
diffstat 1 files changed, 4 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/target-utils/libload/cmd_memload.c	Mon Jun 17 07:18:04 2013 +0000
+++ b/target-utils/libload/cmd_memload.c	Mon Jun 17 07:28:51 2013 +0000
@@ -15,7 +15,7 @@
 	char *argbulk;
 {
 	char *argv[2], *s;
-	u8 srecbin[256];
+	u8 srecbin[256], cksum;
 	int len, i, c;
 	u32 addr;
 
@@ -36,10 +36,10 @@
 		s += 2;
 		srecbin[i] = c;
 	}
-	c = 0;
+	cksum = 0;
 	for (i = 0; i <= len; i++)
-		c += srecbin[i];
-	if (c != 0xFF) {
+		cksum += srecbin[i];
+	if (cksum != 0xFF) {
 		printf("ERROR: bad ML S-record checksum\n");
 		return;
 	}