aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandoc_aux.c
Commit message (Collapse)AuthorAgeFilesLines
* Fix the mandoc_strndup() utility function. All existing callers seemIngo Schwarze2018-02-071-4/+4
| | | | | safe so far, but implementing it with an unchecked memcpy(3) is just wrong and quite dangerous.
* Implement automatic line breakingIngo Schwarze2017-06-121-4/+11
| | | | | inside individual table cells that contain text blocks. This cures overlong lines in various Xenocara manuals.
* Without HAVE_ERR, don't try to include <err.h>, it probably isn't there.Ingo Schwarze2015-11-071-1/+3
| | | | | In that case, the required prototypes are in "config.h". Patch from Peter Bray <pdb_ml at yahoo dot com dot au>.
* Use getprogname(3) rather than __progname.Ingo Schwarze2015-11-061-4/+1
| | | | | | | Suggested by Joerg@ Sonnenberger (NetBSD). Last year, deraadt@ confirmed on tech@ that this "has the potential to be more portable", and micro-optimizing for speed is not relevant here. Also gets rid of one global variable.
* Check the right pointer against NULL;Ingo Schwarze2015-10-121-2/+2
| | | | | fixing a pasto introduced in the previous commit; found by Svyatoslav Mishyn <juef at openmailbox dot org> with cppcheck.
* Finally use __progname, err(3) and warn(3).Ingo Schwarze2015-10-111-25/+18
| | | | | | | | | | That's more readable and less error-prone than fumbling around with argv[0], fprintf(3), strerror(3), perror(3), and exit(3). It's a bad idea to boycott good interfaces merely because standards committees ignore them. Instead, let's provide compatibility modules for archaic systems (like commercial Solaris) that still don't have them. The compat module has an UCB Copyright (c) 1993...
* modernize style: "return" is not a functionIngo Schwarze2015-10-061-8/+8
|
* Get rid of HAVE_CONFIG_H, it is always defined; idea from libnbcompat.Ingo Schwarze2014-08-101-3/+1
| | | | | | Include <sys/types.h> where needed, it does not belong in config.h. Remove <stdio.h> from config.h; if it is missing somewhere, it should be added, but i cannot find a *.c file where it is missing.
* This one needs "config.h", too.Ingo Schwarze2014-07-091-1/+5
|
* Audit malloc(3)/calloc(3)/realloc(3) usage.Ingo Schwarze2014-04-231-1/+13
| | | | | | | * Change eight reallocs to reallocarray to be safe from overflows. * Change one malloc to reallocarray to be safe from overflows. * Change one calloc to reallocarray, no zeroing needed. * Change the order of arguments of three callocs (aesthetical).
* The files mandoc.c and mandoc.h contained both specialised low-levelIngo Schwarze2014-03-231-0/+105
functions used for multiple languages (mdoc, man, roff), for example mandoc_escape(), mandoc_getarg(), mandoc_eos(), and generic auxiliary functions. Split the auxiliaries out into their own file and header.