summaryrefslogtreecommitdiffstats
path: root/util.c
diff options
context:
space:
mode:
authorMatthias-Christian Ott <ott@enolink.de>2008-07-04 18:05:08 +0200
committerMatthias-Christian Ott <ott@enolink.de>2008-07-04 18:05:08 +0200
commitf982c1c37ccc4adc38260a132aa64ee29d1a1a8c (patch)
tree5d2ca4b666b91eed75ce2b16c3cd7ab785e66838 /util.c
parentsimplify flushing (diff)
downloadst-f982c1c37ccc4adc38260a132aa64ee29d1a1a8c.tar.gz
st-f982c1c37ccc4adc38260a132aa64ee29d1a1a8c.zip
replace eprint() functions with BSD error functions
Diffstat (limited to 'util.c')
-rw-r--r--util.c23
1 files changed, 1 insertions, 22 deletions
diff --git a/util.c b/util.c
index f8b9eee..2e33fbd 100644
--- a/util.c
+++ b/util.c
@@ -11,27 +11,6 @@ emallocz(unsigned int size) {
11 void *res = calloc(1, size); 11 void *res = calloc(1, size);
12 12
13 if(!res) 13 if(!res)
14 eprint("fatal: could not malloc() %u bytes\n", size); 14 err(EXIT_FAILURE, "could not malloc() %u bytes\n", size);
15 return res; 15 return res;
16} 16}
17
18void
19eprint(const char *errstr, ...) {
20 va_list ap;
21
22 va_start(ap, errstr);
23 vfprintf(stderr, errstr, ap);
24 va_end(ap);
25 exit(EXIT_FAILURE);
26}
27
28void
29eprintn(const char *errstr, ...) {
30 va_list ap;
31
32 va_start(ap, errstr);
33 vfprintf(stderr, errstr, ap);
34 va_end(ap);
35 fprintf(stderr, ": %s\n", strerror(errno));
36 exit(EXIT_FAILURE);
37}