summaryrefslogtreecommitdiff
path: root/sys/arch/mvme88k/stand/sboot/srec.c
diff options
context:
space:
mode:
Diffstat (limited to 'sys/arch/mvme88k/stand/sboot/srec.c')
-rw-r--r--sys/arch/mvme88k/stand/sboot/srec.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/sys/arch/mvme88k/stand/sboot/srec.c b/sys/arch/mvme88k/stand/sboot/srec.c
index 164fb4b458c..04458ecfcd6 100644
--- a/sys/arch/mvme88k/stand/sboot/srec.c
+++ b/sys/arch/mvme88k/stand/sboot/srec.c
@@ -1,8 +1,9 @@
+/* $OpenBSD: srec.c,v 1.2 2001/04/30 00:06:34 miod Exp $ */
+
/*
* Public domain, believed to be by Mike Price.
*
* convert binary file to Srecord format
- * XXX srec generates improper checksums for 4-byte dumps
*/
#include <stdio.h>
#include <ctype.h>
@@ -73,10 +74,11 @@ main(argc, argv)
}
/*
- * kludge -> don't know why you have to add the +1 = works
- * for size =3 at least
+ * kludge -> some sizes need an extra count (1 if size == 3, 2 if
+ * size == 4). Don't ask why.
*/
- printf("%02X\n", checksum(base, (char *) 0, 0, size) + 1);
+ printf("%02X\n", checksum(base, (char *) 0, 0, size) +
+ (size - 2));
exit (0);
}