summaryrefslogtreecommitdiffstats
path: root/mandoc_aux.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-12 19:05:47 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-12 19:05:47 +0000
commit9d72453df4dc511deb6dc6371e56a40f8fe3c0a8 (patch)
tree5caf35e06b9803aa07004c9ac9c7c3840dc50a36 /mandoc_aux.c
parentb393472ea460fc68b1f16089f9ce2375a7d78374 (diff)
downloadmandoc-9d72453df4dc511deb6dc6371e56a40f8fe3c0a8.tar.gz
Implement automatic line breaking
inside individual table cells that contain text blocks. This cures overlong lines in various Xenocara manuals.
Diffstat (limited to 'mandoc_aux.c')
-rw-r--r--mandoc_aux.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/mandoc_aux.c b/mandoc_aux.c
index b469a0d8..78466d95 100644
--- a/mandoc_aux.c
+++ b/mandoc_aux.c
@@ -1,7 +1,7 @@
/* $Id$ */
/*
* Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
- * Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
*
* Permission to use, copy, modify, and distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
@@ -71,7 +71,6 @@ mandoc_malloc(size_t size)
void *
mandoc_realloc(void *ptr, size_t size)
{
-
ptr = realloc(ptr, size);
if (ptr == NULL)
err((int)MANDOCLEVEL_SYSERR, NULL);
@@ -81,13 +80,21 @@ mandoc_realloc(void *ptr, size_t size)
void *
mandoc_reallocarray(void *ptr, size_t num, size_t size)
{
-
ptr = reallocarray(ptr, num, size);
if (ptr == NULL)
err((int)MANDOCLEVEL_SYSERR, NULL);
return ptr;
}
+void *
+mandoc_recallocarray(void *ptr, size_t oldnum, size_t num, size_t size)
+{
+ ptr = recallocarray(ptr, oldnum, num, size);
+ if (ptr == NULL)
+ err((int)MANDOCLEVEL_SYSERR, NULL);
+ return ptr;
+}
+
char *
mandoc_strdup(const char *ptr)
{