__vsnprintf
function · crt · primitive
- Address
0x73f6ad· 80 bytes, up to0x73f6fc- Signature
int __cdecl (char *buffer, size_t count, const char *format, va_list args)- Meaning
- Formats into count bytes through __output, with a NUL only when room is left; -1 when the text is longer
- Confidence
- verified, proof one
- Name from
- the community database (idb)
- Finding
- crt/printf#the-string-front-ends
- Test
crt::crt_vsnprintf_difftest
Finding: The string front ends in crt: formatted output
sprintf and _vsprintf give __output the count 0x7fffffff; _snprintf and _vsnprintf give
it the caller's count, as a signed int. One more decrement of the count then decides the end: at
zero or above, a NUL at the cursor; below zero, nothing. So a text shorter than the count ends in a
NUL and returns its length; a text of exactly the count has no NUL and returns the count; a longer
one stops at the count with no NUL and returns -1. A count of 0 or from 0x80000001 up leaves no
room: nothing is written, and the return is -1, or 0 for an empty text. 0x80000000 wraps to
0x7fffffff on its first decrement and has no bound.
The derivation is in the doc.
Callers 7
- 0x444ae0 unassigned
- SysMsgVPrintf sysmsg
- CGxDevice::Log gx
- ISStrVPrintf storm
- SErrFormatAndDisplay storm
- 0x64db80 storm
- 0x667440 storm
Callees 2
Calls and jumps by a bare address, from tables/calls.tsv.