# HG changeset patch # User Mike Becker # Date 1471946806 -7200 # Node ID 77c158821738287a8829a1858dd351b297ce390c # Parent 1a67185e5496ac17ccea9377ed6610d49a9ab757 use macros for exit codes diff -r 1a67185e5496 -r 77c158821738 src/c2html.c --- a/src/c2html.c Tue Aug 23 12:05:41 2016 +0200 +++ b/src/c2html.c Tue Aug 23 12:06:46 2016 +0200 @@ -244,7 +244,7 @@ break; case 'h': printhelp(); - return 0; + return EXIT_SUCCESS; case 'v': case 'V': #ifdef VERSION_DEVELOP @@ -252,9 +252,9 @@ #else printf("%d.%d\n", VERSION_MAJOR, VERSION_MINOR); #endif - return 0; + return EXIT_SUCCESS; default: - return 1; + return EXIT_FAILURE; } } @@ -268,7 +268,7 @@ fout = fopen(settings.outfilename, "w"); if (!fout) { perror("Error opening output file"); - return -1; + return EXIT_FAILURE; } } else { fout = stdout; @@ -276,7 +276,7 @@ if (copyfile(settings.headerfile, fout)) { perror("Error opening header file"); - retcode = -1; + retcode = EXIT_FAILURE; goto prog_end; } @@ -308,12 +308,12 @@ freeinputfilebuffer(inputfile); } else { perror("Error opening input file"); - retcode = -1; + retcode = EXIT_FAILURE; } if (copyfile(settings.footerfile, fout)) { perror("Error opening footer file"); - retcode = -1; + retcode = EXIT_FAILURE; } prog_end: