diff --git a/example/example.cpp b/example/example.cpp index 878ad4c5..a4f84c55 100644 --- a/example/example.cpp +++ b/example/example.cpp @@ -3,7 +3,6 @@ // file COPYING or http://www.opensource.org/licenses/mit-license.php. #include -#include #include #include #include @@ -26,7 +25,7 @@ static auto Spawn(mp::EventLoop& loop, const std::string& process_argv0, const s fs::path path = process_argv0; path.remove_filename(); path.append(new_exe_name); - return {path.string(), std::format("{:d}", fd)}; + return {path.string(), std::to_string(fd)}; }); return std::make_tuple(mp::ConnectStream(loop, fd), pid); } diff --git a/src/mp/util.cpp b/src/mp/util.cpp index 15c40b33..691ae0b3 100644 --- a/src/mp/util.cpp +++ b/src/mp/util.cpp @@ -6,7 +6,6 @@ #include #include -#include #include #include #include @@ -86,7 +85,9 @@ std::string LogEscape(const kj::StringTree& string) if (c == '\\') { result.append("\\\\"); } else if (c < 0x20 || c > 0x7e) { - result.append(std::format("\\{:02x}", c)); + char escape[4]; + snprintf(escape, 4, "\\%02x", c); + result.append(escape); } else { result.push_back(c); }