diff options
Diffstat (limited to 'compiler-rt/lib/sanitizer_common/sanitizer_printf.cc')
-rw-r--r-- | compiler-rt/lib/sanitizer_common/sanitizer_printf.cc | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/compiler-rt/lib/sanitizer_common/sanitizer_printf.cc b/compiler-rt/lib/sanitizer_common/sanitizer_printf.cc index 22f10fb1a00..6aeedabdf3f 100644 --- a/compiler-rt/lib/sanitizer_common/sanitizer_printf.cc +++ b/compiler-rt/lib/sanitizer_common/sanitizer_printf.cc @@ -86,7 +86,7 @@ static int AppendPointer(char **buff, const char *buff_end, u64 ptr_value) { int VSNPrintf(char *buff, int buff_length, const char *format, va_list args) { static const char *kPrintfFormatsHelp = "Supported Printf formats: " - "%%[z]{d,u,x}; %%p; %%s\n"; + "%%[z]{d,u,x}; %%p; %%s; %%c\n"; RAW_CHECK(format); RAW_CHECK(buff_length > 0); const char *buff_end = &buff[buff_length - 1]; @@ -127,6 +127,11 @@ int VSNPrintf(char *buff, int buff_length, result += AppendString(&buff, buff_end, va_arg(args, char*)); break; } + case 'c': { + RAW_CHECK_MSG(!have_z, kPrintfFormatsHelp); + result += AppendChar(&buff, buff_end, va_arg(args, uptr)); + break; + } case '%' : { RAW_CHECK_MSG(!have_z, kPrintfFormatsHelp); result += AppendChar(&buff, buff_end, '%'); |