summaryrefslogtreecommitdiffstats
path: root/compat_err.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-11-06 16:30:33 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-11-06 16:30:33 +0000
commita8ce1f9346beb8f6af8a2704f58ad1be8a491a40 (patch)
tree1176af75445468319b8f0983434244892aba9031 /compat_err.c
parentbdcb15a7e65b5df030d7dac778cb68ac4e3277e6 (diff)
downloadmandoc-a8ce1f9346beb8f6af8a2704f58ad1be8a491a40.tar.gz
Use getprogname(3) rather than __progname.
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.
Diffstat (limited to 'compat_err.c')
-rw-r--r--compat_err.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/compat_err.c b/compat_err.c
index 900769c2..01c2fefe 100644
--- a/compat_err.c
+++ b/compat_err.c
@@ -43,15 +43,13 @@ int dummy;
#include <stdlib.h>
#include <string.h>
-extern char *__progname;
-
static void vwarni(const char *, va_list);
static void vwarnxi(const char *, va_list);
static void
vwarnxi(const char *fmt, va_list ap)
{
- fprintf(stderr, "%s: ", __progname);
+ fprintf(stderr, "%s: ", getprogname());
if (fmt != NULL)
vfprintf(stderr, fmt, ap);
}