Changes to main.c to run in linux

Added an exit if read file fails to open. Changed buffer variables as
size changed on linux machine, if any problems show then check the size
of buffer and buffer2, they need to be 32bits.