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; }