summaryrefslogtreecommitdiffstats
path: root/chars.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-03-17 08:49:34 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-03-17 08:49:34 +0000
commitb115f948b8e55e6c3cef4bfa81f62c190af37a59 (patch)
tree36b8ace377de1911ede7b7fca7e4ce75035928c9 /chars.c
parent684938dc1d7c8591d0b63657a1d36b25b24eaea8 (diff)
downloadmandoc-b115f948b8e55e6c3cef4bfa81f62c190af37a59.tar.gz
Move mandoc_{realloc,malloc,calloc} out of libmandoc.h and into mandoc.h
so that everybody can use them. This follows the convention of libXXXX.h being internal to a library and XXXX.h being the external interface. Not only does this allow the removal of lots of redundant NULL-checking code, it also sets the tone for adding new mandoc-global routines.
Diffstat (limited to 'chars.c')
-rw-r--r--chars.c13
1 files changed, 2 insertions, 11 deletions
diff --git a/chars.c b/chars.c
index ae478800..270d4f50 100644
--- a/chars.c
+++ b/chars.c
@@ -92,17 +92,8 @@ chars_init(enum chars type)
* (they're in-line re-ordered during lookup).
*/
- tab = malloc(sizeof(struct ctab));
- if (NULL == tab) {
- perror(NULL);
- exit((int)MANDOCLEVEL_SYSERR);
- }
-
- htab = calloc(PRINT_HI - PRINT_LO + 1, sizeof(struct ln **));
- if (NULL == htab) {
- perror(NULL);
- exit((int)MANDOCLEVEL_SYSERR);
- }
+ tab = mandoc_malloc(sizeof(struct ctab));
+ htab = mandoc_calloc(PRINT_HI - PRINT_LO + 1, sizeof(struct ln **));
for (i = 0; i < LINES_MAX; i++) {
hash = (int)lines[i].code[0] - PRINT_LO;