diff options
Diffstat (limited to 'common')
-rw-r--r-- | common/uart_printf.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/common/uart_printf.c b/common/uart_printf.c index a4fecf5c73..01fd1353d2 100644 --- a/common/uart_printf.c +++ b/common/uart_printf.c @@ -31,10 +31,9 @@ int uart_putc(int c) int uart_puts(const char *outstr) { /* Put all characters in the output buffer */ - for (; *outstr != '\0'; ++outstr) { - if (__tx_char(NULL, *outstr) != 0) { + while (*outstr) { + if (__tx_char(NULL, *outstr++) != 0) break; - } } uart_tx_start(); @@ -49,9 +48,8 @@ int uart_put(const char *out, int len) /* Put all characters in the output buffer */ for (written = 0; written < len; written++) { - if (__tx_char(NULL, *out++) != 0) { + if (__tx_char(NULL, *out++) != 0) break; - } } uart_tx_start(); @@ -65,9 +63,8 @@ int uart_put_raw(const char *out, int len) /* Put all characters in the output buffer */ for (written = 0; written < len; written++) { - if (uart_tx_char_raw(NULL, *out++) != 0) { + if (uart_tx_char_raw(NULL, *out++) != 0) break; - } } uart_tx_start(); |