mirror of
https://github.com/notwa/mm
synced 2024-11-05 02:29:03 -08:00
pad compressed files to multiple of 16 bytes
This commit is contained in:
parent
5c42efeae8
commit
6f98d2f214
1 changed files with 7 additions and 1 deletions
|
@ -260,7 +260,13 @@ int main(int argc, char *argv[])
|
|||
|
||||
long csize = encodeYaz0(bufi, bufo + 16, size) + 16;
|
||||
|
||||
fwrite(bufo, csize, 1, stdout);
|
||||
// pad compressed file to be a multiple of 16 bytes.
|
||||
long ceilsize = (csize + 15) & ~0xF;
|
||||
for (long i = csize; i < ceilsize; i++) {
|
||||
bufo[i] = 0;
|
||||
}
|
||||
|
||||
fwrite(bufo, ceilsize, 1, stdout);
|
||||
free(bufo);
|
||||
}
|
||||
free(bufi);
|
||||
|
|
Loading…
Reference in a new issue