* @brief This function will fill a formatted string to buffer. * * @param buf is the buffer to save formatted string. * * @param size is the size of buffer. * * @param fmt is the format parameters. * * @return The number of characters actually written to buffer. */
| 26 | * @return The number of characters actually written to buffer. |
| 27 | */ |
| 28 | int rt_snprintf(char *buf, rt_size_t size, const char *fmt, ...) |
| 29 | { |
| 30 | rt_int32_t n = 0; |
| 31 | va_list args; |
| 32 | |
| 33 | va_start(args, fmt); |
| 34 | n = rt_vsnprintf(buf, size, fmt, args); |
| 35 | va_end(args); |
| 36 | |
| 37 | return n; |
| 38 | } |
| 39 | RTM_EXPORT(rt_snprintf); |
| 40 | |
| 41 | /** |