diff options
| author | Garrett D'Amore <garrett@damore.org> | 2016-12-10 22:21:04 -0800 |
|---|---|---|
| committer | Garrett D'Amore <garrett@damore.org> | 2016-12-10 22:21:04 -0800 |
| commit | 6a7f5a2a113cd63add78ad72601683529899b2ed (patch) | |
| tree | 6f9120f1fda2e2e13ba7488ab72974e9fc057a49 /src/core/panic.c | |
| parent | 5ee084f07bddeb616f5d1c76798167abb8d0a536 (diff) | |
| download | nng-6a7f5a2a113cd63add78ad72601683529899b2ed.tar.gz nng-6a7f5a2a113cd63add78ad72601683529899b2ed.tar.bz2 nng-6a7f5a2a113cd63add78ad72601683529899b2ed.zip | |
Fix panic to emit backtrace properly.
Diffstat (limited to 'src/core/panic.c')
| -rw-r--r-- | src/core/panic.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/core/panic.c b/src/core/panic.c index 47556f70..e993ddb9 100644 --- a/src/core/panic.c +++ b/src/core/panic.c @@ -42,16 +42,16 @@ show_backtrace(void) #if NNG_HAVE_BACKTRACE void *frames[50]; int nframes; - char *lines; + char **lines; int i; nframes = backtrace(frames, sizeof (frames) / sizeof (frames[0])); if (nframes > 1) { - lines = backtrace_symbols(frames, nframes -1); + lines = backtrace_symbols(frames, nframes); if (lines == NULL) { return; } - for (i = 0; i < nframes; i++) { + for (i = 1; i < nframes; i++) { nni_debug_out(lines[i]); } } |
