[libc] add integer writing to printf
authorMichael Jones <michaelrj@google.com>
Fri, 10 Jun 2022 18:12:40 +0000 (11:12 -0700)
committerMichael Jones <michaelrj@google.com>
Tue, 28 Jun 2022 21:00:46 +0000 (14:00 -0700)
commit88b801392c9378abf26c4bb0eb3bd6a3bacdada7
treeaeb5bf82c93bf5b71f86eb14def88509973943fc
parentf239cddbac3c3cb9ce2da37ee745d1545adc9987
[libc] add integer writing to printf

This patch adds %n to printf, as well as a compiler flag to disable it.
This is due to it having serious security issues when misused.

Reviewed By: lntue

Differential Revision: https://reviews.llvm.org/D127517
libc/src/stdio/printf_core/CMakeLists.txt
libc/src/stdio/printf_core/converter.cpp
libc/src/stdio/printf_core/converter_atlas.h
libc/src/stdio/printf_core/parser.cpp
libc/src/stdio/printf_core/write_int_converter.h [new file with mode: 0644]
libc/test/src/stdio/sprintf_test.cpp