diff options
Diffstat (limited to 'libc/src/stdio/printf_core/printf_main.h')
| -rw-r--r-- | libc/src/stdio/printf_core/printf_main.h | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/libc/src/stdio/printf_core/printf_main.h b/libc/src/stdio/printf_core/printf_main.h index 1c7a7237c097..57f29858d529 100644 --- a/libc/src/stdio/printf_core/printf_main.h +++ b/libc/src/stdio/printf_core/printf_main.h @@ -10,7 +10,6 @@ #define LLVM_LIBC_SRC_STDIO_PRINTF_CORE_PRINTF_MAIN_H #include "src/__support/arg_list.h" -#include "src/__support/error_or.h" #include "src/__support/macros/config.h" #include "src/stdio/printf_core/converter.h" #include "src/stdio/printf_core/core_structs.h" @@ -23,9 +22,8 @@ namespace LIBC_NAMESPACE_DECL { namespace printf_core { template <WriteMode write_mode> -ErrorOr<size_t> printf_main(Writer<write_mode> *writer, - const char *__restrict str, - internal::ArgList &args) { +int printf_main(Writer<write_mode> *writer, const char *__restrict str, + internal::ArgList &args) { Parser<internal::ArgList> parser(str, args); int result = 0; for (FormatSection cur_section = parser.get_next_section(); @@ -35,8 +33,9 @@ ErrorOr<size_t> printf_main(Writer<write_mode> *writer, result = convert(writer, cur_section); else result = writer->write(cur_section.raw_string); + if (result < 0) - return Error(-result); + return result; } return writer->get_chars_written(); |
