summaryrefslogtreecommitdiffstats
path: root/openbsd-compat/bsd-asprintf.c
diff options
context:
space:
mode:
authorDarren Tucker <dtucker@dtucker.net>2018-10-12 16:58:47 +1100
committerDarren Tucker <dtucker@dtucker.net>2018-10-12 16:58:47 +1100
commit797cdd9c8468ed1125ce60d590ae3f1397866af4 (patch)
treeea4e467425c7f809cd20a5d90fe95b34cd7b33e7 /openbsd-compat/bsd-asprintf.c
parente526127cbd2f8ad88fb41229df0c9b850c722830 (diff)
Don't avoid our *sprintf replacements.
Don't let systems with broken printf(3) avoid our replacements via asprintf(3)/vasprintf(3) calling libc internally. From djm@
Diffstat (limited to 'openbsd-compat/bsd-asprintf.c')
-rw-r--r--openbsd-compat/bsd-asprintf.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/openbsd-compat/bsd-asprintf.c b/openbsd-compat/bsd-asprintf.c
index 82236715..10927727 100644
--- a/openbsd-compat/bsd-asprintf.c
+++ b/openbsd-compat/bsd-asprintf.c
@@ -19,6 +19,15 @@
#include "includes.h"
+/*
+ * Don't let systems with broken printf(3) avoid our replacements
+ * via asprintf(3)/vasprintf(3) calling libc internally.
+ */
+#if defined(BROKEN_SNPRINTF)
+# undef HAVE_VASPRINTF
+# undef HAVE_ASPRINTF
+#endif
+
#ifndef HAVE_VASPRINTF
#include <errno.h>