refactor fatal_exit()

This commit is contained in:
Gwenhael Le Moine 2023-09-14 12:52:58 +02:00
parent 268dd34612
commit b595a19af6
No known key found for this signature in database
GPG key ID: FDFE3669426707A7

View file

@ -2,12 +2,10 @@
#include <stdlib.h>
void fatal_exit( char* error, char* advice ) {
if ( error[ 0 ] == '\0' ) {
fprintf( stderr, "FATAL ERROR, exit.\n" );
exit( 1 );
}
fprintf( stderr, "FATAL ERROR, exit.\n" );
fprintf( stderr, "FATAL ERROR, exit.\n - %s\n", error );
if ( error[ 0 ] != '\0' )
fprintf( stderr, " - %s\n", error );
if ( advice[ 0 ] != '\0' )
fprintf( stderr, " - %s\n", advice );