1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <console/vtxprintf.h>
6 struct vsnprintf_context
{
11 static void str_tx_byte(unsigned char byte
, void *data
)
13 struct vsnprintf_context
*ctx
= data
;
21 int vsnprintf(char *buf
, size_t size
, const char *fmt
, va_list args
)
24 struct vsnprintf_context ctx
;
27 ctx
.buf_limit
= size
? size
- 1 : 0;
28 i
= vtxprintf(str_tx_byte
, fmt
, args
, &ctx
);
35 int snprintf(char *buf
, size_t size
, const char *fmt
, ...)
41 i
= vsnprintf(buf
, size
, fmt
, args
);