|author||Rich Felker <firstname.lastname@example.org>||2016-10-21 20:57:15 -0400|
|committer||Rich Felker <email@example.com>||2016-10-21 22:15:31 -0400|
redesign snprintf without undefined behavior
the old snprintf design setup the FILE buffer pointers to point directly into the destination buffer; if n was actually larger than the buffer size, the pointer arithmetic to compute the buffer end pointer was undefined. this affected sprintf, which is implemented in terms of snprintf, as well as some unusual but valid direct uses of snprintf. instead, setup the FILE as unbuffered and have its write function memcpy to the destination. the printf core sets up its own temporary buffer for unbuffered streams.
Diffstat (limited to 'include')
0 files changed, 0 insertions, 0 deletions