xiaoxiang781216 commented on a change in pull request #5519:
URL: https://github.com/apache/incubator-nuttx/pull/5519#discussion_r811134387



##########
File path: libs/libc/string/lib_memchr.c
##########
@@ -49,17 +49,14 @@ FAR void *memchr(FAR const void *s, int c, size_t n)
 {
   FAR const unsigned char *p = (FAR const unsigned char *)s;
 
-  if (s)
+  while (n--)
     {
-      while (n--)
+      if (*p == (unsigned char)c)

Review comment:
       the code may want to avoid depend on whether char extend as unsigned or 
signed.




-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Reply via email to