3 ms·
"Before this refactoring, the sprintf functions, which write formatted data to a character buffer, were implemented by wrapping the result buffer in a temporary
by Karellen 12y ago
"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*
- cremno 12y agoThat's actually common practice. Look at other libc implementations. Even the original implementation did that: http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/libc/stdio/sprintf.c 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/stdio/fprintf.c http://minnie.tuhs.org/cgi-bin/utree.pl?file=V7/usr/src/libc...