benilla-re systems structs docs

vsnoprintf

function · storm · primitive

Address
0x6697d0 · 688 bytes, up to 0x669a7f
Signature
int32_t __cdecl (char *dest, uint32_t size, const char *fmt, va_list args)
Meaning
Formats with each conversion bound to its argument by number and handed to _snprintf; returns the length
Confidence
verified, proof two
Name from
the community database (idb)
Finding
storm/printf#ordered-conversions
Test
storm::vsnoprintf_difftest, storm::isstrvprintf_difftest

Finding: Ordered conversions in storm: printf

vsnoprintf(dest, size, fmt, va) makes three passes. The first records each % spec and, for one taking an argument, stores its kind at its index: N − 1 after %N$, else one past the previous spec's, so a plain spec after %2$s reads argument 3. The last spec naming an index decides its kind. The second reads the arguments from index 0 to the highest named, by kind: 4 bytes for an integer or a pointer, 8 for a long long or a double, 4 for an index no spec names. The third copies the text and hands each spec to _snprintf with its argument, so a repeated index prints one value twice.

The derivation is in the doc.

Callers 4

Callees 5

Calls and jumps by a bare address, from tables/calls.tsv.