Thank you very much. I also found this on Wiki
which I believe is telling me the same thing. The problem cam about because I was doing a checksum on the file/structure, and to avoid including the checksum itself in the checksum calc I did a sizeof(file) - checksumSize. With padding on the end of the file I ended up including the checksum in the calc - not too smart!
In any case, I now injected a variable and calculate the checksum up to the dummy variable - problem solved.
Thanks for your help.