{
expand_next_file (NULL);
fprintf (stderr,"Too many files.\n");
- exit (20);
+ exit (EXIT_FAILURE);
}
else
{
if (argc >= MAXARGS)
{
fprintf (stderr,"Too many files.\n");
- exit (20);
+ exit (EXIT_FAILURE);
}
else
{
*oargv = argv;
if (no_match_at_all && contains_wildcards) {
fprintf (stderr,"No match.\n");
- exit (20);
+ exit (EXIT_FAILURE);
}
}
#include <config.h>
#include <stdio.h>
+#include <stdlib.h>
#define MAGIC1 'S' /* sub data */
#define MAGIC2 26 /* ^Z */
if (getchar() != MAGIC1 || getchar() != MAGIC2)
{
fputs("add: input stream not made by sub\n", stderr);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* get number of differences from data */
if ((n = getchar()) == EOF || (i = getchar()) == EOF) {
fputs("add: unexpected end of file\n", stderr);
- exit(1);
+ exit(EXIT_FAILURE);
}
n += (i<<8);
if (n <= 0 || n > MAX_DIST) {
fprintf(stderr, "add: incorrect distance %d\n", n);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* initialize last byte */
if (i == n) /* cycle on n differences */
i = 0;
}
- exit(0);
+ exit(EXIT_SUCCESS);
return 0; /* avoid warning */
}
#include <config.h>
#include <stdio.h>
+#include <stdlib.h>
#define MAGIC1 'S' /* sub data */
#define MAGIC2 26 /* ^Z */
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]);
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 */
if (i == n) /* cycle on n differences */
i = 0;
}
- exit(0);
+ exit(EXIT_SUCCESS);
return 0; /* avoid warning */
}
#include <config.h>
#include <stdio.h>
+#include <stdlib.h>
/* Trivial example of reading a gzip'ed file or gzip'ed standard input
* using stdio functions fread(), getc(), etc... fseek() is not supported.
if (argc < 1 || argc > 2) {
fprintf(stderr, "usage: %s [file[.gz]]\n", argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
strcpy(cmd, "gzip -dc "); /* use "gzip -c" for zwrite */
if (argc == 2) {
infile = popen(cmd, "r"); /* use "w" for zwrite */
if (infile == NULL) {
fprintf(stderr, "%s: popen('%s', 'r') failed\n", argv[0], cmd);
- exit(1);
+ exit(EXIT_FAILURE);
}
/* Read one byte using getc: */
n = getc(infile);
if (n == EOF) {
pclose(infile);
- exit(0);
+ exit(EXIT_SUCCESS);
}
putchar(n);
}
if (pclose(infile) != 0) {
fprintf(stderr, "%s: pclose failed\n", argv[0]);
- exit(1);
+ exit(EXIT_FAILURE);
}
- exit(0);
+ exit(EXIT_SUCCESS);
return 0; /* just to make compiler happy */
}