tiffsplit: use EXIT_SUCCESS / EXIT_FAILURE
This commit is contained in:
parent
2fa1ce2f55
commit
aea167005f
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user