You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by gu...@apache.org on 2021/07/12 19:50:04 UTC

[incubator-nuttx] 01/02: profs: Print StackAlloc by procfs_snprintf

This is an automated email from the ASF dual-hosted git repository.

gustavonihei pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/incubator-nuttx.git

commit 7ef29ecce64b17d314e93efec336d4a417d139e0
Author: Xiang Xiao <xi...@xiaomi.com>
AuthorDate: Mon Jul 12 22:03:23 2021 +0800

    profs: Print StackAlloc by procfs_snprintf
    
    since snprintf return the wrong number in case of insufficient buffer
    
    Signed-off-by: Xiang Xiao <xi...@xiaomi.com>
---
 fs/procfs/fs_procfsproc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c
index fd532db..a75b520 100644
--- a/fs/procfs/fs_procfsproc.c
+++ b/fs/procfs/fs_procfsproc.c
@@ -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;