mirror of
https://github.com/apache/nuttx.git
synced 2026-08-02 04:38:59 +00:00
libc/execinfo/dumpstack: correct the line size to avoid LF overwrite
Signed-off-by: chao.an <anchao@xiaomi.com>
This commit is contained in:
parent
137eb594cb
commit
b2016e85f5
1 changed files with 2 additions and 2 deletions
|
|
@ -44,7 +44,7 @@
|
|||
void dump_stack(void)
|
||||
{
|
||||
FAR void *address[DUMP_DEPTH];
|
||||
char line[DUMP_LINESIZE];
|
||||
char line[DUMP_LINESIZE + 1];
|
||||
int ret = 0;
|
||||
int size;
|
||||
int i;
|
||||
|
|
@ -61,7 +61,7 @@ void dump_stack(void)
|
|||
DUMP_FORMAT, DUMP_WIDTH, address[i]);
|
||||
if (i == size - 1 || ret % DUMP_LINESIZE == 0)
|
||||
{
|
||||
syslog(LOG_INFO, "[BackTrace]: %s\n", line);
|
||||
syslog(LOG_INFO, "[CallStack %d]: %s\n", i / DUMP_NITEM, line);
|
||||
ret = 0;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue