%z format string

This commit is contained in:
dzaima 2025-05-11 17:08:55 +03:00
parent eca676bb3d
commit 2020135a11
2 changed files with 7 additions and 0 deletions

View File

@ -356,6 +356,7 @@ A fancier message can be created with `thrF(message, …)` with printf-like (but
%ul decimal u64 %ul decimal u64
%xi hex u32 %xi hex u32
%xl hex u64 %xl hex u64
%z decimal ux
%s decimal usz %s decimal usz
%f f64 %f f64
%p pointer %p pointer

View File

@ -310,6 +310,12 @@ NOINLINE B do_fmt(B s, char* p, va_list a) {
A8(buf); A8(buf);
break; break;
} }
case 'z': {
ux v = va_arg(a, ux);
snprintf(buf, 30, "%zu", v);
A8(buf);
break;
}
case 'p': { case 'p': {
snprintf(buf, 30, "%p", va_arg(a, void*)); snprintf(buf, 30, "%p", va_arg(a, void*));
A8(buf); A8(buf);