xiaoxiang781216 commented on code in PR #21072:
URL: https://github.com/apache/nuttx/pull/21072#discussion_r4404321158
##########
libs/libc/stream/lib_libvsprintf.c:
##########
@@ -1018,10 +1030,12 @@ static int vsprintf_internal(FAR struct lib_outstream_s
*stream,
if ((flags & FL_LPAD) == 0)
{
- while (size < width)
+ if (width > 0 && size < (size_t)width)
Review Comment:
remove all cast
##########
libs/libc/stream/lib_libvsprintf.c:
##########
@@ -62,6 +62,10 @@
#define stream_putc(c,stream) (total_len++, lib_stream_putc(stream, c))
#define stream_puts(buf, len, stream) \
(total_len += len, lib_stream_puts(stream, buf, len))
+#define stream_repeat(c, len, stream) \
+ vsprintf_repeat(stream, c, len, &total_len)
Review Comment:
let vsprintf_repeat return length
--
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]