I was looking through copy.c, and if the bf.Size part of BITMAPFILEHEADER includes padding, then how come the amount of padding needed isn't even defined in copy.c until after BITMAPFILEHEADER is declared? How does that work?
// write outfile's BITMAPFILEHEADER
fwrite(&bf, sizeof(BITMAPFILEHEADER), 1, outptr);
// write outfile's BITMAPINFOHEADER
fwrite(&bi, sizeof(BITMAPINFOHEADER), 1, outptr);
// determine padding for scanlines
int padding = (4 - (bi.biWidth * sizeof(RGBTRIPLE)) % 4) % 4;