Studying Linux's code for evaluating format strings...
`vsnprintf()` validates that you didn't give it too large of a buffer & that we've got a valid slice before repeatedly parsing & evaluating format specifiers. It cleans up by returning the nil terminator & returning the length.
It parses a format string by handling precision & width states by updating the state & jumping ahead, setting that state to NONE, scanning ahead to the next "%" or end of string, ...
1/3?
... returns string literals if appropriate, iterates over subsequent flag chars parsing them into bitflags via a small-int-map, checks if a digit's next & parses that as a width, checks if a "."'s next & parses the following digits as the precision or indicates it should be taken from variadic args, looks up the following datatype-char in a lookuptable, parses following chars according to bitflags, & handles any errors.
2/3?