From d35973833e6bf05fec29100a4d5e66bb07b06659 Mon Sep 17 00:00:00 2001 From: Garrett D'Amore Date: Tue, 24 Apr 2018 16:39:35 -0700 Subject: fix a number of cppcheck complaints (not all) --- src/core/panic.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) (limited to 'src/core/panic.c') diff --git a/src/core/panic.c b/src/core/panic.c index f3c7cb26..ff621a59 100644 --- a/src/core/panic.c +++ b/src/core/panic.c @@ -1,5 +1,6 @@ // -// Copyright 2016 Garrett D'Amore +// Copyright 2018 Staysail Systems, Inc. +// Copyright 2018 Capitar IT Group BV // // This software is supplied under the terms of the MIT License, a // copy of which should be located in the distribution where this @@ -23,18 +24,16 @@ void nni_show_backtrace(void) { #if NNG_HAVE_BACKTRACE - void * frames[50]; - int nframes; - char **lines; - int i; + void *frames[50]; + int nframes; nframes = backtrace(frames, sizeof(frames) / sizeof(frames[0])); if (nframes > 1) { - lines = backtrace_symbols(frames, nframes); + char **lines = backtrace_symbols(frames, nframes); if (lines == NULL) { return; } - for (i = 1; i < nframes; i++) { + for (int i = 1; i < nframes; i++) { nni_println(lines[i]); } } -- cgit v1.2.3-70-g09d2