From 2424b1285742806496c17a9eef4c68e7172f717c Mon Sep 17 00:00:00 2001 From: wangjianyu3 Date: Mon, 23 Jun 2025 17:00:07 +0800 Subject: [PATCH] fs/procfs: fix output format of fd info Refered to PRINTF(3), the [v]snprintf returns the number of characters printed (excluding the null byte used to end output to strings). Signed-off-by: wangjianyu3 --- fs/procfs/fs_procfsproc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/fs/procfs/fs_procfsproc.c b/fs/procfs/fs_procfsproc.c index 94f3035770..cfdebd9d59 100644 --- a/fs/procfs/fs_procfsproc.c +++ b/fs/procfs/fs_procfsproc.c @@ -1330,7 +1330,7 @@ static ssize_t proc_groupfd(FAR struct proc_file_s *procfile, fdp->f_backtrace, CONFIG_FS_BACKTRACE); #endif - procfile->line[linesize - 2] = '\n'; + procfile->line[linesize - 1] = '\n'; } file_put(filep);