diff options
author | June McEnroe <june@causal.agency> | 2024-05-22 12:16:41 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2024-05-22 12:16:41 -0400 |
commit | 625662a5c1cbb71cf37653df1f31cd60c48b18ae (patch) | |
tree | 7a04a48f7007b30f086b353c0c03002c861383b9 /bin/shotty.l | |
parent | Add photo descriptions from 05-03 and 05-06 (diff) | |
download | src-625662a5c1cbb71cf37653df1f31cd60c48b18ae.tar.gz src-625662a5c1cbb71cf37653df1f31cd60c48b18ae.zip |
Remove use of sysexits.h
Diffstat (limited to 'bin/shotty.l')
-rw-r--r-- | bin/shotty.l | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/bin/shotty.l b/bin/shotty.l index dcac43ec..b6d54eee 100644 --- a/bin/shotty.l +++ b/bin/shotty.l @@ -26,7 +26,6 @@ #include <stdlib.h> #include <string.h> #include <sys/ioctl.h> -#include <sysexits.h> #include <unistd.h> #include <wchar.h> @@ -554,25 +553,25 @@ int main(int argc, char *argv[]) { break; case 'n': hide = true; break; case 's': size = true; break; case 'w': cols = atoi(optarg); - break; default: return EX_USAGE; + break; default: return 1; } } if (optind < argc) { yyin = fopen(argv[optind], "r"); - if (!yyin) err(EX_NOINPUT, "%s", argv[optind]); + if (!yyin) err(1, "%s", argv[optind]); } if (size) { struct winsize win; int error = ioctl(STDERR_FILENO, TIOCGWINSZ, &win); - if (error) err(EX_IOERR, "ioctl"); + if (error) err(1, "ioctl"); cols = win.ws_col; rows = win.ws_row; } scr.bot = rows; cells = calloc(cols * rows, sizeof(*cells)); - if (!cells) err(EX_OSERR, "calloc"); + if (!cells) err(1, "calloc"); erase(cell(0, 0), cell(rows-1, cols)); bool mc = false; |