1
0
mirror of https://github.com/CTCaer/hekate.git synced 2024-12-27 12:16:43 +00:00

bdk: sprintf: do not accept null chars

Skip NULL chars on putc since they break the resulted string.
This commit is contained in:
CTCaer 2024-01-06 21:52:48 +02:00
parent 92093ff08e
commit dab5eb9aa0

View File

@ -112,7 +112,9 @@ void s_printf(char *out_buf, const char *fmt, ...)
switch (*fmt) switch (*fmt)
{ {
case 'c': case 'c':
_s_putc(va_arg(ap, u32)); char c = va_arg(ap, u32);
if (c != '\0')
_s_putc(c);
break; break;
case 's': case 's':
_s_puts(va_arg(ap, char *)); _s_puts(va_arg(ap, char *));