firmware-utils: mkmylofw: fix blocks padding
authorRafał Miłecki <rafal@milecki.pl>
Tue, 13 Apr 2021 11:53:57 +0000 (13:53 +0200)
committerRafał Miłecki <rafal@milecki.pl>
Tue, 13 Apr 2021 12:00:49 +0000 (14:00 +0200)
commit232cb45a6627c3483388d46096c70e8e454f0cfd
tree505fc1902243a938ce8db0602eeb350d9accc42f
parent6bcc768a81aaf7d3b93ecdc355118bd94e0aa3b7
firmware-utils: mkmylofw: fix blocks padding

The old code didn't make sense as it was using "len" variable which was
guaranteed to be always 0. Loop right above broken code is:
while (len > 0) { }

With this recent ALIGN macro fix this resulted in subtracting block size
from 0 and calling write_out_padding() with a negative length.

To calculate amount of bytes needed for padding & alignment it should be
enough to use % 4.

Fixes: a2f66229450d ("firmware-utils: fix few random warnings")
Signed-off-by: Rafał Miłecki <rafal@milecki.pl>
src/mkmylofw.c