lxclock: cleanup dump_stacktrace()

parent 2f116a90
...@@ -36,7 +36,6 @@ static inline void dump_stacktrace(void) ...@@ -36,7 +36,6 @@ static inline void dump_stacktrace(void)
void *array[MAX_STACKDEPTH]; void *array[MAX_STACKDEPTH];
size_t size; size_t size;
char **strings; char **strings;
size_t i;
size = backtrace(array, MAX_STACKDEPTH); size = backtrace(array, MAX_STACKDEPTH);
strings = backtrace_symbols(array, size); strings = backtrace_symbols(array, size);
...@@ -44,7 +43,7 @@ static inline void dump_stacktrace(void) ...@@ -44,7 +43,7 @@ static inline void dump_stacktrace(void)
/* Using fprintf here as our logging module is not thread safe. */ /* Using fprintf here as our logging module is not thread safe. */
fprintf(stderr, "\tObtained %zu stack frames\n", size); fprintf(stderr, "\tObtained %zu stack frames\n", size);
for (i = 0; i < size; i++) for (int i = 0; i < size; i++)
fprintf(stderr, "\t\t%s\n", strings[i]); fprintf(stderr, "\t\t%s\n", strings[i]);
free(strings); free(strings);
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment