diff options
| author | Garrett D'Amore <garrett@damore.org> | 2019-05-07 20:26:05 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2019-05-07 20:26:05 -0700 |
| commit | 2b87c219ca07aebcf6e8ff02009dca88babc04c3 (patch) | |
| tree | c4d727615f01748280b93f3abc99ac3a6c7eb488 /src/platform/posix/posix_debug.c | |
| parent | c036b3e4a365a966215e383c1130c66d96aa917b (diff) | |
| download | nng-2b87c219ca07aebcf6e8ff02009dca88babc04c3.tar.gz nng-2b87c219ca07aebcf6e8ff02009dca88babc04c3.tar.bz2 nng-2b87c219ca07aebcf6e8ff02009dca88babc04c3.zip | |
Introduce nni_plat_printf()
This permits the stats dump to avoid some extra buffering,
and resolves a complaint about possible format buffer overruns.
Diffstat (limited to 'src/platform/posix/posix_debug.c')
| -rw-r--r-- | src/platform/posix/posix_debug.c | 12 |
1 files changed, 11 insertions, 1 deletions
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 <garrett@damore.org> +// Copyright 2019 Staysail Systems, Inc. <info@staysail.tech> // // 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 <errno.h> +#include <stdarg.h> #include <stdio.h> #include <stdlib.h> #include <string.h> @@ -23,6 +24,15 @@ nni_plat_abort(void) } 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) { fputs(message, stderr); |
