-/* $Id: mandoc_aux.c,v 1.6 2015/10/11 21:12:54 schwarze Exp $ */
+/* $Id: mandoc_aux.c,v 1.9 2015/11/07 14:22:29 schwarze Exp $ */
/*
* Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014 Ingo Schwarze <schwarze@openbsd.org>
#include <sys/types.h>
+#if HAVE_ERR
#include <err.h>
+#endif
#include <stdarg.h>
#include <stdlib.h>
#include <stdio.h>
#include "mandoc.h"
#include "mandoc_aux.h"
-#if !HAVE_PROGNAME
-const char *mandoc_progname;
-#endif
int
mandoc_asprintf(char **dest, const char *fmt, ...)
char *p;
p = strdup(ptr);
- if (ptr == NULL)
+ if (p == NULL)
err((int)MANDOCLEVEL_SYSERR, NULL);
return p;
}