summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKeith Packard <keithp@keithp.com>2017-01-06 09:10:23 -0800
committerKeith Packard <keithp@keithp.com>2017-02-20 11:22:21 -0800
commitf0c187dd6479996b83f85b6decf303ec0fc70fe5 (patch)
tree0ab879de409ff50d907bc6eab0878e56c0fe0b6a
parent61f729567ff6355ab52c3e83399761103022a41a (diff)
ao-tools/ao-usbload: Pad image with 0xff instead of random bits
Clear the temporary block to 0xff before copying in the target data so that any unused bytes end up being left at 0xff instead of inheriting whatever data was in the block before. Signed-off-by: Keith Packard <keithp@keithp.com>
-rw-r--r--ao-tools/lib/ao-selfload.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/ao-tools/lib/ao-selfload.c b/ao-tools/lib/ao-selfload.c
index 0a23dfda..754cd784 100644
--- a/ao-tools/lib/ao-selfload.c
+++ b/ao-tools/lib/ao-selfload.c
@@ -110,6 +110,7 @@ ao_self_write(struct cc_usb *cc, struct ao_hex_image *image)
start = image->address;
if (stop > image->address + image->length)
stop = image->address + image->length;
+ memset(block, 0xff, 0x100);
memcpy(block + start - address, image->data + start - image->address, stop - start);
ao_self_block_write(cc, address, block);
ao_self_block_read(cc, address, check);