diff options
| author | Garrett D'Amore <garrett@damore.org> | 2017-06-26 18:27:06 -0700 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2017-06-26 18:27:06 -0700 |
| commit | ac80ef7c3b1caa2f1fe3b093bef825363675bcb3 (patch) | |
| tree | 567857cedd1b618de2daabab26bb672abc055f40 /src/core/panic.c | |
| parent | e095c624882b94141eca64a4746ac186683556f3 (diff) | |
| download | nng-ac80ef7c3b1caa2f1fe3b093bef825363675bcb3.tar.gz nng-ac80ef7c3b1caa2f1fe3b093bef825363675bcb3.tar.bz2 nng-ac80ef7c3b1caa2f1fe3b093bef825363675bcb3.zip | |
More race condition fixes.
Diffstat (limited to 'src/core/panic.c')
| -rw-r--r-- | src/core/panic.c | 6 |
1 files changed, 4 insertions, 2 deletions
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"); |
