Please sign in to comment.
Prevent unnecessary null block if image is already aligned
If the user makes use of the `align` option but the image is already aligned, the module will append a whole null chunk independently on whether there is remaining data to flush or not. This PR checks the remaining data buffer length, and only runs the alignment routine if there is really something to align. In the test case added below, the result was `1234\0\0\0\0`. `1234` is already aligned in 4 bytes chunks, but the code adds 4 null bytes at the end anyway. Signed-off-by: Juan Cruz Viotti <firstname.lastname@example.org>
- Loading branch information...