in the stream. See sub.c for what the filtering is and what it's
good for. */
+#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 */
}