Shanks0224 commented on code in PR #22177:
URL: https://github.com/apache/nuttx/pull/22177#discussion_r4676123257


##########
libs/libc/string/lib_strcasestr.c:
##########
@@ -78,7 +78,7 @@ FAR char *strcasestr(FAR const char *str, FAR const char 
*substr)
   /* Search for the substring */
 
   candidate = str;
-  ch        = toupper(ch);
+  ch        = (char)toupper((unsigned char)ch);

Review Comment:
   Fixed: the converted value is kept in an int (`int uc = toupper((unsigned 
char)ch)`), so it compares equal in strcasechr(). `strcasestr("caf\xe9", 
"\xe9")` finds the byte again on sim.



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