| 27 | |
| 28 | #ifdef __GNUC__ |
| 29 | void __wrap_rtl_printf(const char *fmt, ...) |
| 30 | { |
| 31 | va_list args; |
| 32 | rt_size_t length; |
| 33 | static char rt_log_buf[RT_CONSOLEBUF_SIZE]; |
| 34 | |
| 35 | va_start(args, fmt); |
| 36 | /* the return value of vsnprintf is the number of bytes that would be |
| 37 | * written to buffer had if the size of the buffer been sufficiently |
| 38 | * large excluding the terminating null byte. If the output string |
| 39 | * would be larger than the rt_log_buf, we have to adjust the output |
| 40 | * length. */ |
| 41 | length = rt_vsnprintf(rt_log_buf, sizeof(rt_log_buf) - 1, fmt, args); |
| 42 | if (length > RT_CONSOLEBUF_SIZE - 1) |
| 43 | length = RT_CONSOLEBUF_SIZE - 1; |
| 44 | rt_kprintf("%s", rt_log_buf); |
| 45 | va_end(args); |
| 46 | } |
| 47 | #endif |
| 48 | |
| 49 | /** |
nothing calls this directly
no test coverage detected