Simple data packing/unpacking in C