Add binary support to tinyprintf (#7024)

This commit is contained in:
Joel Challis 2019-10-15 13:33:06 +01:00 committed by GitHub
parent cc5edb9eeb
commit 2ac4197b73
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -186,6 +186,15 @@ void tfp_format(void* putp, putcf putf, char* fmt, va_list va) {
case 's':
putchw(putp, putf, w, 0, va_arg(va, char*));
break;
case 'b':
#ifdef PRINTF_LONG_SUPPORT
if (lng)
uli2a(va_arg(va, unsigned long int), 2, 0, bf);
else
#endif
ui2a(va_arg(va, unsigned int), 2, 0, bf);
putchw(putp, putf, w, lz, bf);
break;
case '%':
putf(putp, ch);
default: