benilla-re systems structs docs

_strftime

function · crt · orchestration

Address
0x4134e3 · 27 bytes, up to 0x4134fd
Signature
uint32_t __cdecl (char *out, uint32_t max, const char *format, const tm *fields)
Meaning
Calls _Strftime with no time record
Confidence
verified, proof one
Finding
crt/time#the-strftime-format-loop
Test
crt::crt_strftime_difftest, crt::crt_strftime_patterns_difftest

Finding: The strftime format loop in crt: calendar time

strftime(out, max, format, tm) calls _Strftime with no time record, which takes __lc_time_curr, the C locale's record. It copies each byte of the format that is not % while room is left. A % clears the # mark, takes a # after it as the mark, and expands the next byte, whatever it is: a format that ends in % expands its NUL, which writes nothing, and reads on past it. The loop ends when the room or the format runs out; with room left it writes a NUL and answers the bytes before it, else it answers 0 with no NUL written.

The derivation is in the doc.

Callers 3

Callees 1

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