iodev: Do not print leading * for empty buffer prints on alt path

Signed-off-by: Hector Martin <marcan@marcan.st>
This commit is contained in:
Hector Martin 2021-05-27 21:10:00 +09:00
parent 0786894201
commit aa72f50e50

View file

@ -83,10 +83,12 @@ int in_iodev = 0;
void iodev_console_write(const void *buf, size_t length) void iodev_console_write(const void *buf, size_t length)
{ {
if (in_iodev || !is_primary_core()) { if (in_iodev || !is_primary_core()) {
if (length) {
iodev_write(IODEV_UART, "*", 1); iodev_write(IODEV_UART, "*", 1);
iodev_write(IODEV_UART, buf, length); iodev_write(IODEV_UART, buf, length);
return; return;
} }
}
in_iodev++; in_iodev++;
dprintf(" iodev_console_write() wp=%d\n", con_wp); dprintf(" iodev_console_write() wp=%d\n", con_wp);