1 | // SPDX-License-Identifier: GPL-3.0-or-later |
2 | |
3 | #include "mos_stdio.h" |
4 | |
5 | #include <limits.h> |
6 | |
7 | int sprintf(char *__restrict str, const char *__restrict format, ...) |
8 | { |
9 | va_list args; |
10 | va_start(args, format); |
11 | int ret = vsprintf(str, format, ap: args); |
12 | va_end(args); |
13 | return ret; |
14 | } |
15 | |
16 | int snprintf(char *__restrict str, size_t size, const char *__restrict format, ...) |
17 | { |
18 | va_list args; |
19 | va_start(args, format); |
20 | int ret = vsnprintf(buf: str, size, format, args); |
21 | va_end(args); |
22 | return ret; |
23 | } |
24 | |
25 | int vsprintf(char *__restrict str, const char *__restrict format, va_list ap) |
26 | { |
27 | return vsnprintf(buf: str, INT_MAX, format, args: ap); |
28 | } |
29 | |