"Before this refactoring, the sprintf functions, which write formatted data to a character buffer, were implemented by wrapping the result buffer in a temporary FILE object and then deferring to the equivalent fprintf function."
*headdesk*
*headdesk*
Even the original implementation did that:
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/libc...
http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/libc...