profs: Print StackAlloc by procfs_snprintf

since snprintf return the wrong number in case of insufficient buffer

Signed-off-by: Xiang Xiao <xiaoxiang@xiaomi.com>
This commit is contained in:
Xiang Xiao 2021-07-12 22:03:23 +08:00 committed by Gustavo Henrique Nihei
parent e5c278981a
commit 7ef29ecce6
1 changed files with 2 additions and 2 deletions

View File

@ -894,7 +894,7 @@ static ssize_t proc_stack(FAR struct proc_file_s *procfile,
/* Show the stack alloc address */
linesize = snprintf(procfile->line, STATUS_LINELEN, "%-12s%p\n",
linesize = procfs_snprintf(procfile->line, STATUS_LINELEN, "%-12s%p\n",
"StackAlloc:", tcb->stack_alloc_ptr);
copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining,
&offset);
@ -1010,7 +1010,7 @@ static ssize_t proc_groupstatus(FAR struct proc_file_s *procfile,
linesize = procfs_snprintf(procfile->line, STATUS_LINELEN, "%-12s%d\n",
"Members:", group->tg_nmembers);
copysize = procfs_memcpy(procfile->line, linesize, buffer,
remaining, &offset);
remaining, &offset);
totalsize += copysize;
buffer += copysize;