casaroli commented on code in PR #21474:
URL: https://github.com/apache/nuttx/pull/21474#discussion_r4477201496
##########
libs/libc/stream/lib_libvsprintf.c:
##########
@@ -866,7 +1018,7 @@ static int vsprintf_internal(FAR struct lib_outstream_s
*stream,
/* Pull digits from buffer when in-range, otherwise use 0 */
- if (0 <= exp - n && exp - n < ndigs)
+ if ((unsigned int)exp - n < (unsigned int)ndigs)
Review Comment:
`exp` is negative for a value below 1, so it stays `int`. `ndigs` is
unsigned now and a local `unsigned int uexp` replaces the casts.
--
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]