aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorH. Peter Anvin <hpa@zytor.com>2010-02-05 18:17:10 -0800
committerH. Peter Anvin <hpa@zytor.com>2010-02-05 18:17:10 -0800
commit247dbe7aaec8d4a29fdf599e21dbb5a54de14f8b (patch)
tree479e4c4fbaf8ed31fa423d99683bf86a31225197
parent3dededd20d70d571268417dc41edc95f0fe6602e (diff)
downloadsyslinux.git-247dbe7aaec8d4a29fdf599e21dbb5a54de14f8b.tar.gz
syslinux.git-247dbe7aaec8d4a29fdf599e21dbb5a54de14f8b.tar.xz
syslinux.git-247dbe7aaec8d4a29fdf599e21dbb5a54de14f8b.zip
memdump: srecs need a length, and max 32 data bytes
Length + 32 data bytes max... Signed-off-by: H. Peter Anvin <hpa@zytor.com>
-rw-r--r--memdump/srecsend.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/memdump/srecsend.c b/memdump/srecsend.c
index 668d16cb..78f32edf 100644
--- a/memdump/srecsend.c
+++ b/memdump/srecsend.c
@@ -16,12 +16,7 @@ static void make_srec(struct serial_if *sif, char type, size_t addr,
uint8_t csum;
p = buf;
- *p++ = 'S';
- *p++ = type;
- if (type == '0')
- p += sprintf(p, "%04zX", addr);
- else
- p += sprintf(p, "%08zX", addr);
+ p += sprintf(p, "S%c%02X%0*zX", type, len+alen+1, alen, addr);
csum = (len+alen+1) + addr + (addr >> 8) + (addr >> 16) + (addr >> 24);
while (len) {
@@ -62,7 +57,7 @@ void send_srec(struct serial_if *sif, struct file_info *fileinfo,
np = blk_buf;
while (bytes) {
- chunk = bytes > 64 ? 64 : bytes;
+ chunk = bytes > 32 ? 32 : bytes;
make_srec(sif, '3', addr, np, chunk);