diff options
Diffstat (limited to 'convcom.c')
-rw-r--r-- | convcom.c | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/convcom.c b/convcom.c new file mode 100644 index 0000000..b3818c9 --- /dev/null +++ b/convcom.c @@ -0,0 +1,14 @@ +#include "config.h" + +int align_size(int s, int a) { + return (s + (a - 1)) & -a; +} + +void pad_file(int size, FILE* outfile) { + const char n = 0; + int as = align_size(size, allocation_default_alignment); + int i = as - size; + for (; i; i--) + fwrite(&n, 1, 1, outfile); +} + |