benilla-re systems structs docs

__un_inc

function · crt · boundary

Address
0x745897 · 23 bytes, up to 0x7458ad
Signature
void __cdecl (int32_t c, void *stream)
Meaning
Pushes a byte back into a stream through _ungetc_lk, and does nothing for EOF
Confidence
verified, proof one
Name from
the community database (idb)
Finding
crt/scanf#the-string-stream
Test
crt::crt_sscanf_fixed_difftest, crt::crt_sscanf_random_difftest

Finding: The string stream in crt: formatted input

sscanf(s, fmt, ...) (0x73fb5d) builds a stack FILE with _ptr and _base at s, _cnt its length and _flag 0x49 (read, string, own buffer), and answers __input(stream, fmt, args) (0x744e21). _inc (0x74587d) takes the next byte, unsigned, while --_cnt is not negative; past the end __filbuf (0x745946) answers EOF, −1, and the count keeps falling. __un_inc (0x745897) ignores EOF; _ungetc_lk (0x741c1b) keeps its step back and raises _cnt only when the byte there is the one pushed, so a pushback never changes the string, and at the start with _cnt other than 0 it refuses. __whiteout (0x7458ae) counts and reads until a byte is not a space.

The derivation is in the doc.

Callers 1

Callees 1

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