From dbdb24e2e0edded3294c6fbd0ef7c374639200dd Mon Sep 17 00:00:00 2001 From: ligd Date: Wed, 28 Apr 2021 17:44:58 +0800 Subject: [PATCH] procfs: fix cat status error when meet long thread name nsh> cat /proc/3/status Name: init123456789987654Type: Task Group: 3 State: Running Change-Id: Iddef8fa1fe3a02d407244f46fa05e3f35dd7c84e Signed-off-by: ligd --- 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 47d062af22..f82354326f 100644 --- a/fs/procfs/fs_procfsproc.c +++ b/fs/procfs/fs_procfsproc.c @@ -459,8 +459,8 @@ static ssize_t proc_status(FAR struct proc_file_s *procfile, #else name = ""; #endif - linesize = procfs_snprintf(procfile->line, STATUS_LINELEN, "%-12s%s\n", - "Name:", name); + linesize = procfs_snprintf(procfile->line, STATUS_LINELEN, + "%-12s%.18s\n", "Name:", name); copysize = procfs_memcpy(procfile->line, linesize, buffer, remaining, &offset);