X-Git-Url: https://git.gag.com/?a=blobdiff_plain;ds=sidebyside;f=sample%2Fsub.c;fp=sample%2Fsub.c;h=a06cc9bef2fa239f41cfbfdfe4fa6b016e760f8b;hb=c7e61475680fa226bd9b8bdd469cd66914e630f5;hp=ec57ca4f232adf0f492a7f8ecf26caf90843b72a;hpb=800deb09b422a73c1212233a93839a223ff59678;p=debian%2Fgzip diff --git a/sample/sub.c b/sample/sub.c index ec57ca4..a06cc9b 100644 --- a/sample/sub.c +++ b/sample/sub.c @@ -33,7 +33,9 @@ gunzip < double.data.sgz | add > double.data */ +#include #include +#include #define MAGIC1 'S' /* sub data */ #define MAGIC2 26 /* ^Z */ @@ -54,7 +56,7 @@ int main(argc, argv) if (argc > 2) { fputs("sub: only one argument needed--# of differences\n", stderr); - exit(1); + exit(EXIT_FAILURE); } if (argc > 1) n = atoi(argv[1]); @@ -62,7 +64,7 @@ int main(argc, argv) if (n < 0) n = -n; /* tolerate "sub -2" */ if (n == 0 || n > MAX_DIST) { fputs("sub: incorrect distance\n", stderr); - exit(1); + exit(EXIT_FAILURE); } /* initialize last byte */ @@ -83,6 +85,6 @@ int main(argc, argv) if (i == n) /* cycle on n differences */ i = 0; } - exit(0); + exit(EXIT_SUCCESS); return 0; /* avoid warning */ }