[PATCH 26/46] lib: fwts_backtrace: reduce scope of variables
Colin King
colin.king at canonical.com
Tue Jan 13 19:04:45 UTC 2015
From: Colin Ian King <colin.king at canonical.com>
cppcheck is picking up some minor style issues which can
be easily fixed:
[src/lib/src/fwts_backtrace.c:44]:
(style) The scope of the variable 'bt_strings' can be reduced.
[src/lib/src/fwts_backtrace.c:45]:
(style) The scope of the variable 'i' can be reduced.
Signed-off-by: Colin Ian King <colin.king at canonical.com>
---
src/lib/src/fwts_backtrace.c | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/src/lib/src/fwts_backtrace.c b/src/lib/src/fwts_backtrace.c
index eb84b48..f8dd23f 100644
--- a/src/lib/src/fwts_backtrace.c
+++ b/src/lib/src/fwts_backtrace.c
@@ -41,11 +41,11 @@ static size_t bt_size = 0;
*/
void fwts_print_backtrace(void)
{
- char **bt_strings;
- size_t i;
-
fprintf(stderr, "Backtrace:\n");
if (bt_size) {
+ char **bt_strings;
+ size_t i;
+
bt_strings = backtrace_symbols(bt_buff, bt_size);
for (i = 0; i < bt_size; i++) {
--
2.1.4
More information about the fwts-devel
mailing list