So in copy.c the formula for padding is:
padding = (4 - (bi.biWidth * sizeof(RGBTRIPLE)) % 4) % 4;
which I don't quite understand. For example (to my understanding) if the image is 3x3 the padding should be 1 as per the formula but instead I get the following: padding = (4 - (3 * 3) % 4) % 4 = (4 - (9) % 4) % 4 = (4 - 1) % 4 = 3 % 4 = 3 If someone could explain this to me I would greatly appreciate it