From 92c367a844f2f26d325d4ee6ca032894e94f7a06 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Thu, 17 Mar 2011 08:49:34 +0000 Subject: 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. --- main.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) (limited to 'main.c') diff --git a/main.c b/main.c index 496024e1..083b74ee 100644 --- a/main.c +++ b/main.c @@ -1,4 +1,4 @@ -/* $Id: main.c,v 1.151 2011/03/16 15:28:35 kristaps Exp $ */ +/* $Id: main.c,v 1.152 2011/03/17 08:49:34 kristaps Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2011 Ingo Schwarze @@ -405,11 +405,7 @@ resize_buf(struct buf *buf, size_t initial) { buf->sz = buf->sz > initial/2 ? 2 * buf->sz : initial; - buf->buf = realloc(buf->buf, buf->sz); - if (NULL == buf->buf) { - perror(NULL); - exit((int)MANDOCLEVEL_SYSERR); - } + buf->buf = mandoc_realloc(buf->buf, buf->sz); } -- cgit v1.2.3-56-ge451