summaryrefslogtreecommitdiffstats
path: root/term.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-10-30 18:43:24 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-10-30 18:43:24 +0000
commitea8cd0ee934ae86efb80393ca7b51e913e55043f (patch)
treebcb6bc3fb271ba628322b5e83d21979abc00ba5d /term.c
parente46c16c46ad18d40f21b251bf8995387efa68796 (diff)
downloadmandoc-ea8cd0ee934ae86efb80393ca7b51e913e55043f.tar.gz
Continued safe handling of allocations.
Diffstat (limited to 'term.c')
-rw-r--r--term.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/term.c b/term.c
index 3fdb4cc1..15ab98ef 100644
--- a/term.c
+++ b/term.c
@@ -77,8 +77,11 @@ term_alloc(enum termenc enc)
{
struct termp *p;
- if (NULL == (p = calloc(1, sizeof(struct termp))))
- return(NULL);
+ p = calloc(1, sizeof(struct termp));
+ if (NULL == p) {
+ fprintf(stderr, "memory exhausted\n");
+ exit(EXIT_FAILURE);
+ }
p->maxrmargin = 78;
p->enc = enc;
return(p);