nsxiv9e52ae7
Merge commit '3a81af4'
+12 −12
4 files changed
- M commands.c +3 −3
- M main.c +3 −3
- M options.c +5 −5
- M util.c +1 −1
| @@ -48,7 +48,7 @@ extern int filecnt, fileidx; | |||
| 48 | 48 | ||
| 49 | 49 | bool it_quit(arg_t a) { | |
| 50 | 50 | cleanup(); | |
| 51 | − | exit(0); | |
| 51 | + | exit(EXIT_SUCCESS); | |
| 52 | 52 | } | |
| 53 | 53 | ||
| 54 | 54 | bool it_switch_mode(arg_t a) { | |
| @@ -388,7 +388,7 @@ bool it_open_with(arg_t a) { | |||
| 388 | 388 | execlp(prog, prog, | |
| 389 | 389 | files[mode == MODE_IMAGE ? fileidx : tns.sel].path, NULL); | |
| 390 | 390 | warn("could not exec: %s", prog); | |
| 391 | − | exit(1); | |
| 391 | + | exit(EXIT_FAILURE); | |
| 392 | 392 | } else if (pid < 0) { | |
| 393 | 393 | warn("could not fork. program was: %s", prog); | |
| 394 | 394 | } | |
| @@ -415,7 +415,7 @@ bool it_shell_cmd(arg_t a) { | |||
| 415 | 415 | if ((pid = fork()) == 0) { | |
| 416 | 416 | execl("/bin/sh", "/bin/sh", "-c", cmdline, NULL); | |
| 417 | 417 | warn("could not exec: /bin/sh. command line was: %s", cmdline); | |
| 418 | − | exit(1); | |
| 418 | + | exit(EXIT_FAILURE); | |
| 419 | 419 | } else if (pid < 0) { | |
| 420 | 420 | warn("could not fork. command line was: %s", cmdline); | |
| 421 | 421 | return false; | |
| @@ -471,12 +471,12 @@ int main(int argc, char **argv) { | |||
| 471 | 471 | if (options->clean_cache) { | |
| 472 | 472 | tns_init(&tns, 0, NULL); | |
| 473 | 473 | tns_clean_cache(&tns); | |
| 474 | − | exit(0); | |
| 474 | + | exit(EXIT_SUCCESS); | |
| 475 | 475 | } | |
| 476 | 476 | ||
| 477 | 477 | if (!options->filecnt) { | |
| 478 | 478 | print_usage(); | |
| 479 | − | exit(1); | |
| 479 | + | exit(EXIT_FAILURE); | |
| 480 | 480 | } | |
| 481 | 481 | ||
| 482 | 482 | if (options->recursive || options->from_stdin) | |
| @@ -526,7 +526,7 @@ int main(int argc, char **argv) { | |||
| 526 | 526 | ||
| 527 | 527 | if (!fileidx) { | |
| 528 | 528 | fprintf(stderr, "sxiv: no valid image file given, aborting\n"); | |
| 529 | − | exit(1); | |
| 529 | + | exit(EXIT_FAILURE); | |
| 530 | 530 | } | |
| 531 | 531 | ||
| 532 | 532 | filecnt = fileidx; | |
| @@ -75,7 +75,7 @@ void parse_options(int argc, char **argv) { | |||
| 75 | 75 | switch (opt) { | |
| 76 | 76 | case '?': | |
| 77 | 77 | print_usage(); | |
| 78 | − | exit(1); | |
| 78 | + | exit(EXIT_FAILURE); | |
| 79 | 79 | case 'c': | |
| 80 | 80 | _options.clean_cache = true; | |
| 81 | 81 | break; | |
| @@ -93,12 +93,12 @@ void parse_options(int argc, char **argv) { | |||
| 93 | 93 | break; | |
| 94 | 94 | case 'h': | |
| 95 | 95 | print_usage(); | |
| 96 | − | exit(0); | |
| 96 | + | exit(EXIT_SUCCESS); | |
| 97 | 97 | case 'n': | |
| 98 | 98 | if (!sscanf(optarg, "%d", &t) || t < 1) { | |
| 99 | 99 | fprintf(stderr, "sxiv: invalid argument for option -n: %s\n", | |
| 100 | 100 | optarg); | |
| 101 | − | exit(1); | |
| 101 | + | exit(EXIT_FAILURE); | |
| 102 | 102 | } else { | |
| 103 | 103 | _options.startnum = t - 1; | |
| 104 | 104 | } | |
| @@ -120,7 +120,7 @@ void parse_options(int argc, char **argv) { | |||
| 120 | 120 | break; | |
| 121 | 121 | case 'v': | |
| 122 | 122 | print_version(); | |
| 123 | − | exit(0); | |
| 123 | + | exit(EXIT_SUCCESS); | |
| 124 | 124 | case 'Z': | |
| 125 | 125 | _options.scalemode = SCALE_ZOOM; | |
| 126 | 126 | _options.zoom = 1.0; | |
| @@ -130,7 +130,7 @@ void parse_options(int argc, char **argv) { | |||
| 130 | 130 | if (!sscanf(optarg, "%d", &t) || t <= 0) { | |
| 131 | 131 | fprintf(stderr, "sxiv: invalid argument for option -z: %s\n", | |
| 132 | 132 | optarg); | |
| 133 | − | exit(1); | |
| 133 | + | exit(EXIT_FAILURE); | |
| 134 | 134 | } | |
| 135 | 135 | _options.zoom = (float) t / 100.0; | |
| 136 | 136 | break; | |
| @@ -87,7 +87,7 @@ void die(const char* fmt, ...) { | |||
| 87 | 87 | va_end(args); | |
| 88 | 88 | ||
| 89 | 89 | cleanup(); | |
| 90 | − | exit(1); | |
| 90 | + | exit(EXIT_FAILURE); | |
| 91 | 91 | } | |
| 92 | 92 | ||
| 93 | 93 | ssize_t get_line(char **buf, size_t *n, FILE *stream) { | |