From d3b3c96385a9f456ac7a0e8f7eaa615d1dfc78d4 Mon Sep 17 00:00:00 2001 From: June McEnroe Date: Wed, 22 May 2024 19:39:44 -0400 Subject: Remove use of sysexits.h Preserve exit status 69 (EX_UNAVAILABLE) for getting disconnected. Use 127 for failing to exec, like the shell. --- buffer.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) (limited to 'buffer.c') diff --git a/buffer.c b/buffer.c index f82e553..6a7b412 100644 --- a/buffer.c +++ b/buffer.c @@ -30,7 +30,6 @@ #include #include #include -#include #include #include #include @@ -50,7 +49,7 @@ struct Buffer { struct Buffer *bufferAlloc(void) { struct Buffer *buffer = calloc(1, sizeof(*buffer)); - if (!buffer) err(EX_OSERR, "calloc"); + if (!buffer) err(1, "calloc"); return buffer; } @@ -107,7 +106,7 @@ static int flow(struct Lines *hard, int cols, const struct Line *soft) { line->heat = soft->heat; line->time = soft->time; line->str = strdup(soft->str); - if (!line->str) err(EX_OSERR, "strdup"); + if (!line->str) err(1, "strdup"); int width = 0; int align = 0; @@ -185,7 +184,7 @@ static int flow(struct Lines *hard, int cols, const struct Line *soft) { size_t cap = StyleCap + align + strlen(&wrap[n]) + 1; line->str = malloc(cap); - if (!line->str) err(EX_OSERR, "malloc"); + if (!line->str) err(1, "malloc"); char *end = &line->str[cap]; str = seprintf(line->str, end, "%*s", (width = align), ""); @@ -209,7 +208,7 @@ int bufferPush( soft->heat = heat; soft->time = time; soft->str = strdup(str); - if (!soft->str) err(EX_OSERR, "strdup"); + if (!soft->str) err(1, "strdup"); if (heat < thresh) return 0; return flow(&buffer->hard, cols, soft); } -- cgit 1.4.1