From 2b87c219ca07aebcf6e8ff02009dca88babc04c3 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 7 May 2019 20:26:05 -0700 Subject: Introduce nni_plat_printf() This permits the stats dump to avoid some extra buffering, and resolves a complaint about possible format buffer overruns. --- src/platform/posix/posix_debug.c | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) (limited to 'src/platform/posix/posix_debug.c') diff --git a/src/platform/posix/posix_debug.c b/src/platform/posix/posix_debug.c index 7619e8e8..80f37225 100644 --- a/src/platform/posix/posix_debug.c +++ b/src/platform/posix/posix_debug.c @@ -1,5 +1,5 @@ // -// Copyright 2017 Garrett D'Amore +// Copyright 2019 Staysail Systems, Inc. // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -12,6 +12,7 @@ #ifdef NNG_PLATFORM_POSIX #include +#include #include #include #include @@ -22,6 +23,15 @@ nni_plat_abort(void) abort(); } +void +nni_plat_printf(const char *fmt, ...) +{ + va_list ap; + va_start(ap, ap); + (void) vprintf(fmt, ap); + va_end(ap); +} + void nni_plat_println(const char *message) { -- cgit v1.2.3-70-g09d2