changeset 199:96f56e875862

fc-loadtool: minor polish in build_flashw_hex_string()
author Michael Spacefalcon <msokolov@ivan.Harhan.ORG>
date Thu, 19 Dec 2013 08:06:06 +0000
parents c9ea2f7441a5
children 2847b6cbd915
files loadtools/flutil.c
diffstat 1 files changed, 4 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/loadtools/flutil.c	Sun Dec 15 08:48:52 2013 +0000
+++ b/loadtools/flutil.c	Thu Dec 19 08:06:06 2013 +0000
@@ -140,13 +140,10 @@
 	char *s;
 
 	for (dp = bin, s = strbuf, i = 0; i < nwords; dp += 2, s += 4, i++) {
-		if (m0src) {
-			sprintf(s, "%02X", dp[0]);
-			sprintf(s + 2, "%02X", dp[1]);
-		} else {
-			sprintf(s, "%02X", dp[1]);
-			sprintf(s + 2, "%02X", dp[0]);
-		}
+		if (m0src)
+			sprintf(s, "%02X%02X", dp[0], dp[1]);
+		else
+			sprintf(s, "%02X%02X", dp[1], dp[0]);
 	}
 	*s = '\0';
 }