mirror of
https://github.com/gwenhael-le-moine/c-urs_-toil-s.git
synced 2025-01-14 08:01:19 +01:00
explicit exit codes
This commit is contained in:
parent
a4130d1526
commit
e67b6382c7
1 changed files with 3 additions and 3 deletions
6
star.c
6
star.c
|
@ -510,7 +510,7 @@ int parse_args( int argc, char* argv[], struct options *o, struct state *s )
|
||||||
switch(c) {
|
switch(c) {
|
||||||
case 'h' :
|
case 'h' :
|
||||||
printf( "%s\n", help_text );
|
printf( "%s\n", help_text );
|
||||||
exit(0);
|
exit( EXIT_SUCCESS );
|
||||||
case 'b' :
|
case 'b' :
|
||||||
o->black_and_white = 1;
|
o->black_and_white = 1;
|
||||||
break;
|
break;
|
||||||
|
@ -526,7 +526,7 @@ int parse_args( int argc, char* argv[], struct options *o, struct state *s )
|
||||||
break;
|
break;
|
||||||
case '?' :
|
case '?' :
|
||||||
case ':' :
|
case ':' :
|
||||||
exit( 0 );
|
exit( EXIT_SUCCESS );
|
||||||
default : break;
|
default : break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -555,7 +555,7 @@ int main( int argc, char* argv[] )
|
||||||
struct options *o = malloc( sizeof( struct options ) );
|
struct options *o = malloc( sizeof( struct options ) );
|
||||||
|
|
||||||
if ( s == NULL || o == NULL ) {
|
if ( s == NULL || o == NULL ) {
|
||||||
exit( 1 ); /* Guys, we're out of memory */
|
exit( EXIT_FAILURE ); /* Guys, we're out of memory */
|
||||||
}
|
}
|
||||||
|
|
||||||
/* trick to count how many levels we have */
|
/* trick to count how many levels we have */
|
||||||
|
|
Loading…
Reference in a new issue