From eaf190661fdfb58bddc28ee6d0d737aee5374709 Mon Sep 17 00:00:00 2001 From: Barry Revzin Date: Fri, 24 Dec 2021 17:39:35 -0600 Subject: [PATCH] Escaping chars in a less shitty, but actually compiling for real, way --- include/fmt/format.h | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/include/fmt/format.h b/include/fmt/format.h index 68ae3667..3c09c056 100644 --- a/include/fmt/format.h +++ b/include/fmt/format.h @@ -1700,10 +1700,9 @@ auto write_escaped_char(OutputIt out, Char v) -> OutputIt { template auto write_escaped_char(OutputIt out, char v) -> OutputIt { *out++ = '\''; - if ((needs_escape(v) && v != '"') || v == '\'') { - out = write_escaped_cp(out, find_escape_result{ - &v, &v+1, static_cast(v) - }); + if ((needs_escape(static_cast(v)) && v != '"') || v == '\'') { + out = write_escaped_cp( + out, find_escape_result{&v, &v + 1, static_cast(v)}); } else { *out++ = v; }