You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by "Gary-Hobson (via GitHub)" <gi...@apache.org> on 2023/03/07 11:41:48 UTC

[GitHub] [nuttx] Gary-Hobson commented on a diff in pull request #8756: libc/libvsprintf: use puts to replace the putc

Gary-Hobson commented on code in PR #8756:
URL: https://github.com/apache/nuttx/pull/8756#discussion_r1127732598


##########
libs/libc/stdio/lib_libvsprintf.c:
##########
@@ -947,16 +949,9 @@ static int vsprintf_internal(FAR struct lib_outstream_s *stream,
                 }
             }
 
-          while (size)
-            {
-              stream_putc(*pnt++, stream);
-              if (width != 0)
-                {
-                  width -= 1;
-                }
-
-              size -= 1;
-            }
+          stream_puts(pnt, size, stream);
+          width = width >= size ? width - size : 0;
+          size -= size;

Review Comment:
   done



-- 
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: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org