=================================================================== RCS file: /cvs/mandoc/html.c,v retrieving revision 1.71 retrieving revision 1.72 diff -u -p -r1.71 -r1.72 --- mandoc/html.c 2009/10/30 04:57:17 1.71 +++ mandoc/html.c 2009/10/30 18:43:24 1.72 @@ -1,4 +1,4 @@ -/* $Id: html.c,v 1.71 2009/10/30 04:57:17 kristaps Exp $ */ +/* $Id: html.c,v 1.72 2009/10/30 18:43:24 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -100,17 +100,16 @@ html_alloc(char *outopts) toks[2] = "includes"; toks[3] = NULL; - if (NULL == (h = calloc(1, sizeof(struct html)))) - return(NULL); + h = calloc(1, sizeof(struct html)); + if (NULL == h) { + fprintf(stderr, "memory exhausted\n"); + exit(EXIT_FAILURE); + } h->tags.head = NULL; h->ords.head = NULL; + h->symtab = chars_init(CHARS_HTML); - if (NULL == (h->symtab = chars_init(CHARS_HTML))) { - free(h); - return(NULL); - } - while (outopts && *outopts) switch (getsubopt(&outopts, UNCONST(toks), &v)) { case (0): @@ -354,8 +353,11 @@ print_otag(struct html *h, enum htmltag tag, struct tag *t; if ( ! (HTML_NOSTACK & htmltags[tag].flags)) { - if (NULL == (t = malloc(sizeof(struct tag)))) - err(EXIT_FAILURE, "malloc"); + t = malloc(sizeof(struct tag)); + if (NULL == t) { + fprintf(stderr, "memory exhausted\n"); + exit(EXIT_FAILURE); + } t->tag = tag; t->next = h->tags.head; h->tags.head = t;