From: Keith Packard Date: Fri, 6 Jan 2017 17:10:23 +0000 (-0800) Subject: ao-tools/ao-usbload: Pad image with 0xff instead of random bits X-Git-Tag: 1.7~103 X-Git-Url: https://git.gag.com/?p=fw%2Faltos;a=commitdiff_plain;h=f0c187dd6479996b83f85b6decf303ec0fc70fe5;hp=61f729567ff6355ab52c3e83399761103022a41a 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 --- 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);