yamt commented on code in PR #15945:
URL: https://github.com/apache/nuttx/pull/15945#discussion_r2024080158


##########
fs/littlefs/lfs_vfs.c:
##########
@@ -1362,6 +1387,11 @@ static int littlefs_bind(FAR struct inode *driver, FAR 
const void *data,
         }
     }
 
+  if (data && strstr(data, "ro"))

Review Comment:
   using strstr this way doesn't seem like a great idea, especially for a very 
short string as "ro", which can be easily a part of unrelated words.
   ideally we should have a parser which recognizes comma separations.
   
   for now, as i guess it's rare for users to want to specify "ro" with other 
options (forceformat/autoformat), maybe it's good enough to use `!strcmp(data, 
"ro")`.
   what do you think?
   



-- 
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-unsubscr...@nuttx.apache.org

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

Reply via email to