sizeof long is 8 bytes for x86_64 gcc => change to int for 4 byte field.