From ac80ef7c3b1caa2f1fe3b093bef825363675bcb3 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Mon, 26 Jun 2017 18:27:06 -0700 Subject: More race condition fixes. --- src/core/panic.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/core/panic.c') diff --git a/src/core/panic.c b/src/core/panic.c index 2205779f..b3d64dc3 100644 --- a/src/core/panic.c +++ b/src/core/panic.c @@ -55,10 +55,12 @@ nni_panic(const char *fmt, ...) va_list va; va_start(va, fmt); - (void) snprintf(fbuf, sizeof (fbuf), "panic: %s", fmt); - (void) vsnprintf(buf, sizeof (buf), fbuf, va); + (void) vsnprintf(fbuf, sizeof (fbuf), fmt, va); va_end(va); + + (void) snprintf(buf, sizeof (buf), "panic: %s", fbuf); + nni_println(buf); nni_println("This message is indicative of a BUG."); nni_println("Report this at http://github.com/nanomsg/nanomsg"); -- cgit v1.2.3-70-g09d2