diff --git a/src/libs/QR-Code-generator/qrtosvg.cpp b/src/libs/QR-Code-generator/qrtosvg.cpp index 4312ce8..7341876 100644 --- a/src/libs/QR-Code-generator/qrtosvg.cpp +++ b/src/libs/QR-Code-generator/qrtosvg.cpp @@ -1,5 +1,4 @@ #include "qrtosvg.hpp" -#include #include std::string toSvgString(const qrcodegen::QrCode& qr, int border) @@ -9,23 +8,23 @@ std::string toSvgString(const qrcodegen::QrCode& qr, int border) if (border > INT_MAX / 2 || border * 2 > INT_MAX - qr.getSize()) throw std::overflow_error("Border too large"); - std::ostringstream sb; - sb << "\n"; - sb << "\n"; - sb << "\n"; - sb << "\t\n"; - sb << "\t\n"; + sb += "\n"; + sb += "\n" + + "\t\n" + + "\t\n"; - sb << "\n"; - return sb.str(); + sb += "\" fill=\"#000000\"/>\n"; + sb += "\n"; + return sb; } diff --git a/src/settings/wifi/password.cpp b/src/settings/wifi/password.cpp index 251e837..9679cf5 100644 --- a/src/settings/wifi/password.cpp +++ b/src/settings/wifi/password.cpp @@ -3,7 +3,6 @@ #include #include #include -#include #include #include #include diff --git a/src/system/uptime/uptime.cpp b/src/system/uptime/uptime.cpp index de7f759..1884abf 100644 --- a/src/system/uptime/uptime.cpp +++ b/src/system/uptime/uptime.cpp @@ -2,7 +2,6 @@ #ifdef __linux__ #include #endif // __linux__ -#include #include namespace api @@ -15,15 +14,14 @@ namespace api struct sysinfo x; if (sysinfo(&x) == 0) { - std::stringstream responsedata; - responsedata << R"({"uptime":{"hour":")" - << static_cast(x.uptime) / 3600ULL - << R"(","minute":")" - << static_cast(x.uptime) / 60ULL % 60ULL - << R"(","second":")" - << static_cast(x.uptime) % 60ULL - << R"("}})"; - response.set_content(responsedata.str(), JSON_TYPE); + std::string responsedata(R"({"uptime":{"hour":")" + + std::to_string(static_cast(x.uptime) / 3600ULL) + + R"(","minute":")" + + std::to_string(static_cast(x.uptime) / 60ULL % 60ULL) + + R"(","second":")" + + std::to_string(static_cast(x.uptime) % 60ULL) + + R"("}})"); + response.set_content(responsedata, JSON_TYPE); return; } response.set_content(R"({"error":"unknown"})", JSON_TYPE);