Changed the exit(1) to exit(EXIT_FAILURE).