You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/11/28 15:05:42 UTC

[GitHub] [nuttx] pkarashchenko commented on a diff in pull request #7723: meminfo: buflen identify the left of buffer

pkarashchenko commented on code in PR #7723:
URL: https://github.com/apache/nuttx/pull/7723#discussion_r1033658182


##########
fs/procfs/fs_procfsmeminfo.c:
##########
@@ -328,7 +328,7 @@ static ssize_t meminfo_read(FAR struct file *filep, FAR char *buffer,
     }
 
 #ifdef CONFIG_MM_PGALLOC
-  if (totalsize < buflen)
+  if (buflen)

Review Comment:
   ```suggestion
     if (buflen > 0)
   ```
   



##########
fs/procfs/fs_procfsmeminfo.c:
##########
@@ -359,7 +359,7 @@ static ssize_t meminfo_read(FAR struct file *filep, FAR char *buffer,
 #endif
 
 #if defined(CONFIG_ARCH_HAVE_PROGMEM) && defined(CONFIG_FS_PROCFS_INCLUDE_PROGMEM)
-  if (totalsize < buflen)
+  if (buflen)

Review Comment:
   ```suggestion
     if (buflen > 0)
   ```
   



##########
fs/procfs/fs_procfsmeminfo.c:
##########
@@ -302,7 +302,7 @@ static ssize_t meminfo_read(FAR struct file *filep, FAR char *buffer,
 
   for (entry = g_procfs_meminfo; entry != NULL; entry = entry->next)
     {
-      if (totalsize < buflen)
+      if (buflen)

Review Comment:
   ```suggestion
         if (buflen > 0)
   ```
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org