This is an automated email from the ASF dual-hosted git repository.
pkarashchenko pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 19baa56fb5 procfs/cpuinfo: Zero copylen in cpuinfo_read
19baa56fb5 is described below
commit 19baa56fb53bb3de12e0a022d74a32b8bc8de6b7
Author: Xiang Xiao <[email protected]>
AuthorDate: Sun Dec 10 10:56:12 2023 +0800
procfs/cpuinfo: Zero copylen in cpuinfo_read
to avoid return the negative number
Signed-off-by: Xiang Xiao <[email protected]>
---
fs/procfs/fs_procfscpuinfo.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/fs/procfs/fs_procfscpuinfo.c b/fs/procfs/fs_procfscpuinfo.c
index 73f7ffb40d..c818dd6284 100644
--- a/fs/procfs/fs_procfscpuinfo.c
+++ b/fs/procfs/fs_procfscpuinfo.c
@@ -157,6 +157,10 @@ static ssize_t cpuinfo_read(FAR struct file *filep, FAR
char *buffer,
{
filep->f_pos += copylen;
}
+ else
+ {
+ copylen = 0;
+ }
return copylen;
}