diff options
author | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-13 08:03:53 -0600 |
---|---|---|
committer | Luke T. Shumaker <lukeshu@lukeshu.com> | 2025-04-13 08:04:07 -0600 |
commit | d3b4d23a8077d74cd4628948e4687d2d5c24de80 (patch) | |
tree | 514159fee157425b395ecef2ab2abd1fe234a0b3 /libfmt | |
parent | 5bc79bdbccc0d2dd7279837629091b31529d9870 (diff) |
libfmt: Fix flushing on host builds
Diffstat (limited to 'libfmt')
-rw-r--r-- | libfmt/libmisc.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/libfmt/libmisc.c b/libfmt/libmisc.c index 97a2c80..803b281 100644 --- a/libfmt/libmisc.c +++ b/libfmt/libmisc.c @@ -5,7 +5,7 @@ */ #include <stdarg.h> /* for va_list, va_start(), va_end() */ -#include <stdio.h> /* for vprintf(), putchar() */ +#include <stdio.h> /* for vprintf(), putchar(), fflush() */ #if LIB_PICO_STDIO #include <pico/stdio.h> /* for stdio_putchar_raw() */ #endif @@ -37,6 +37,7 @@ int __lm_printf(const char *format, ...) { int ret = vprintf(format, va); #else int ret = fmt_vfctprintf(libfmt_libc_fct, NULL, format, va); + fflush(stdout); #endif va_end(va); return ret; @@ -55,6 +56,7 @@ int __lm_light_printf(const char *format, ...) { stdio_flush(); #else int ret = fmt_vfctprintf(libfmt_libc_fct, NULL, format, va); + fflush(stdout); #endif va_end(va); return ret; |