The C99 exit() function is used for normal program termination. Nested calls to exit() result in undefined behavior. This most frequently occurs when multiple functions are registered with atexit().
...
The C99 exit() function is used for normal program termination. Nested calls to exit() result in undefined behavior. This most frequently occurs when multiple functions are registered with atexit().
...