1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/vtxprintf.h>
7 struct vsnprintf_context
{
12 static void str_tx_byte(unsigned char byte
, void *data
)
14 struct vsnprintf_context
*ctx
= data
;
22 int vsnprintf(char *buf
, size_t size
, const char *fmt
, va_list args
)
25 struct vsnprintf_context ctx
;
28 ctx
.buf_limit
= size
? size
- 1 : 0;
29 i
= vtxprintf(str_tx_byte
, fmt
, args
, &ctx
);
36 int snprintf(char *buf
, size_t size
, const char *fmt
, ...)
42 i
= vsnprintf(buf
, size
, fmt
, args
);