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



##########
File path: libs/libc/string/lib_strrchr.c
##########
@@ -37,15 +37,13 @@
 #undef strrchr /* See mm/README.txt */
 FAR char *strrchr(FAR const char *s, int c)
 {
-  if (s)
+  const char *p = &s[strlen(s)];

Review comment:
       ```suggestion
     FAR const char *p = &s[strlen(s)];
   ```

##########
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:
       not related to this PR, but just curious why we are using `unsigned 
char` and not `char` here




-- 
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