diff options
author | June McEnroe <june@causal.agency> | 2024-05-22 19:39:44 -0400 |
---|---|---|
committer | June McEnroe <june@causal.agency> | 2024-05-22 19:39:44 -0400 |
commit | d3b3c96385a9f456ac7a0e8f7eaa615d1dfc78d4 (patch) | |
tree | 920ef7c7a642d01d8063f234ef4c63d865ad9808 /filter.c | |
parent | Pronouns (diff) | |
download | catgirl-d3b3c96385a9f456ac7a0e8f7eaa615d1dfc78d4.tar.gz catgirl-d3b3c96385a9f456ac7a0e8f7eaa615d1dfc78d4.zip |
Remove use of sysexits.h
Preserve exit status 69 (EX_UNAVAILABLE) for getting disconnected. Use 127 for failing to exec, like the shell.
Diffstat (limited to 'filter.c')
-rw-r--r-- | filter.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/filter.c b/filter.c index a7f9a29..bbe40c8 100644 --- a/filter.c +++ b/filter.c @@ -31,7 +31,6 @@ #include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sysexits.h> #include "chat.h" @@ -48,14 +47,14 @@ struct Filter filterParse(enum Heat heat, char *pattern) { } struct Filter filterAdd(enum Heat heat, const char *pattern) { - if (len == FilterCap) errx(EX_CONFIG, "filter limit exceeded"); + if (len == FilterCap) errx(1, "filter limit exceeded"); char *own; if (!strchr(pattern, '!') && !strchr(pattern, ' ')) { int n = asprintf(&own, "%s!*@*", pattern); - if (n < 0) err(EX_OSERR, "asprintf"); + if (n < 0) err(1, "asprintf"); } else { own = strdup(pattern); - if (!own) err(EX_OSERR, "strdup"); + if (!own) err(1, "strdup"); } struct Filter filter = filterParse(heat, own); filters[len++] = filter; @@ -105,7 +104,7 @@ static void icedPush(const char *msgID) { size_t i = iced.len % IcedCap; free(iced.msgIDs[i]); iced.msgIDs[i] = strdup(msgID); - if (!iced.msgIDs[i]) err(EX_OSERR, "strdup"); + if (!iced.msgIDs[i]) err(1, "strdup"); iced.len++; } |