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
;
30 ctx
.buf_limit
= size
? size
- 1 : 0;
31 i
= vtxprintf(str_tx_byte
, fmt
, args
, &ctx
);
40 int snprintf(char *buf
, size_t size
, const char *fmt
, ...)
46 i
= vsnprintf(buf
, size
, fmt
, args
);