CVSROOT:        /cvs
Module name:    src
Changes by:     t...@cvs.openbsd.org    2017/11/21 10:48:19

Modified files:
        lib/libc/stdio : vfprintf.c 

Log message:
Use a simple forward search to find '%' in the format string instead of
using mbrtowc(3). Thus, we now treat the format string as a bytestring,
not as a multibyte character string.

We think that ANSI C made a small error when adding wide characters:
The committees essentially replaced "characters" with "wide characters"
in the existing printf documentation, which was written before the
concept of processing was established. Doing processing on the format
string would break some 8-bit format strings in the wild, and that
isn't something these committees gave themselves license to do.

Based on the "10x printf speedup" commit from android found by tedu:
https://github.com/aosp-mirror/platform_bionic/commit/5305a4d4a723b06494b93f2df81733b83a0c46d3

Thanks to millert and schwarze for digging into the history and
testing *printf behavior on other platforms.

ok deraadt, millert

Reply via email to