X-Git-Url: https://git.cameronkatri.com/mandoc.git/blobdiff_plain/a2d8a3c6fa626ad4db1bdf75c3eff1b3916d15e9..1f8ebfcb6a16709ba0748e288a058a66786be68a:/chars.c?ds=inline diff --git a/chars.c b/chars.c index eed57247..880a1f6d 100644 --- a/chars.c +++ b/chars.c @@ -1,4 +1,4 @@ -/* $Id: chars.c,v 1.2 2009/09/17 08:21:42 kristaps Exp $ */ +/* $Id: chars.c,v 1.11 2009/10/31 06:10:57 kristaps Exp $ */ /* * Copyright (c) 2009 Kristaps Dzonsons * @@ -15,7 +15,7 @@ * OR IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE. */ #include -#include +#include #include #include @@ -38,7 +38,7 @@ struct ln { #define CHARS_BOTH (0x03) }; -#define LINES_MAX 266 +#define LINES_MAX 351 #define CHAR(w, x, y, z, a, b) \ { NULL, (w), (y), (a), (x), (z), (b), CHARS_CHAR }, @@ -89,13 +89,17 @@ chars_init(enum chars type) * (they're in-line re-ordered during lookup). */ - if (NULL == (tab = malloc(sizeof(struct tbl)))) - err(1, "malloc"); - tab->type = type; + tab = malloc(sizeof(struct tbl)); + if (NULL == tab) { + perror(NULL); + exit(EXIT_FAILURE); + } htab = calloc(PRINT_HI - PRINT_LO + 1, sizeof(struct ln **)); - if (NULL == htab) - err(1, "malloc"); + if (NULL == htab) { + perror(NULL); + exit(EXIT_FAILURE); + } for (i = 0; i < LINES_MAX; i++) { hash = (int)lines[i].code[0] - PRINT_LO; @@ -111,6 +115,7 @@ chars_init(enum chars type) } tab->htab = htab; + tab->type = type; return(tab); }