diff options
author | Thomas Deutschmann <whissi@gentoo.org> | 2021-03-30 10:59:39 +0200 |
---|---|---|
committer | Thomas Deutschmann <whissi@gentoo.org> | 2021-04-01 00:04:14 +0200 |
commit | 5ff1d6955496b3cf9a35042c9ac35db43bc336b1 (patch) | |
tree | 6d470f7eb448f59f53e8df1010aec9dad8ce1f72 /tiff/tools/tiffsplit.c | |
parent | Import Ghostscript 9.53.1 (diff) | |
download | ghostscript-gpl-patches-ghostscript-9.54.tar.gz ghostscript-gpl-patches-ghostscript-9.54.tar.bz2 ghostscript-gpl-patches-ghostscript-9.54.zip |
Import Ghostscript 9.54ghostscript-9.54
Signed-off-by: Thomas Deutschmann <whissi@gentoo.org>
Diffstat (limited to 'tiff/tools/tiffsplit.c')
-rw-r--r-- | tiff/tools/tiffsplit.c | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/tiff/tools/tiffsplit.c b/tiff/tools/tiffsplit.c index c8b7f2dd..43b6fdc1 100644 --- a/tiff/tools/tiffsplit.c +++ b/tiff/tools/tiffsplit.c @@ -30,6 +30,13 @@ #include "tiffio.h" +#ifndef EXIT_SUCCESS +#define EXIT_SUCCESS 0 +#endif +#ifndef EXIT_FAILURE +#define EXIT_FAILURE 1 +#endif + #ifndef HAVE_GETOPT extern int getopt(int argc, char * const argv[], const char *optstring); #endif @@ -60,7 +67,7 @@ main(int argc, char* argv[]) if (argc < 2) { fprintf(stderr, "%s\n\n", TIFFGetVersion()); fprintf(stderr, "usage: tiffsplit input.tif [prefix]\n"); - return (-3); + return (EXIT_FAILURE); } if (argc > 2) { strncpy(fname, argv[2], sizeof(fname)); @@ -83,14 +90,14 @@ main(int argc, char* argv[]) _TIFFfree(path); if (out == NULL) - return (-2); + return (EXIT_FAILURE); if (!tiffcp(in, out)) - return (-1); + return (EXIT_FAILURE); TIFFClose(out); } while (TIFFReadDirectory(in)); (void) TIFFClose(in); } - return (0); + return (EXIT_SUCCESS); } static void @@ -117,7 +124,7 @@ newfilename(void) if (fnum == MAXFILES) { if (!defname || fname[0] == 'z') { fprintf(stderr, "tiffsplit: too many files.\n"); - exit(1); + exit(EXIT_FAILURE); } fname[0]++; fnum = 0; |