[minor fix] Replaced exit(1) with exit(EXIT_FAILURE) and exit(0) with exit(EXIT_SUCCESS) for portability.

Note: There is an exit(-1) line 43, this is a non standard exit value and it is usually turned into "255" by the system. This should be checked.