mirror of
https://github.com/apache/nuttx.git
synced 2026-06-02 01:21:26 +08:00
libc/libvsprintf: use puts to replace the putc
Signed-off-by: yinshengkai <yinshengkai@xiaomi.com>
This commit is contained in:
@@ -68,6 +68,8 @@
|
|||||||
#endif
|
#endif
|
||||||
|
|
||||||
#define stream_putc(c,stream) (total_len++, lib_stream_putc(stream, c))
|
#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))
|
||||||
|
|
||||||
/* Order is relevant here and matches order in format string */
|
/* Order is relevant here and matches order in format string */
|
||||||
|
|
||||||
@@ -947,16 +949,9 @@ str_lpad:
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
while (size)
|
stream_puts(pnt, size, stream);
|
||||||
{
|
width = width >= size ? width - size : 0;
|
||||||
stream_putc(*pnt++, stream);
|
size = 0;
|
||||||
if (width != 0)
|
|
||||||
{
|
|
||||||
width -= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
size -= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
goto tail;
|
goto tail;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user