* @brief This function will fill a formatted string to buffer * * @param buf the buffer to save formatted string. * * @param format is the format parameters. * * @return The number of characters actually written to buffer. */
| 65 | * @return The number of characters actually written to buffer. |
| 66 | */ |
| 67 | int rt_sprintf(char *buf, const char *format, ...) |
| 68 | { |
| 69 | rt_int32_t n = 0; |
| 70 | va_list arg_ptr; |
| 71 | |
| 72 | va_start(arg_ptr, format); |
| 73 | n = rt_vsprintf(buf, format, arg_ptr); |
| 74 | va_end(arg_ptr); |
| 75 | |
| 76 | return n; |
| 77 | } |
| 78 | RTM_EXPORT(rt_sprintf); |
| 79 | |
| 80 | #ifdef RT_KLIBC_USING_LIBC_VSNPRINTF |